We did not like how SharePoint 2010’s “Add new item” was on the bottom of the page. we wanted to move it to the top. The following jQuery code moves it to the top of the page:
It does nearly the same as yours, but incorporates it into the top of the listview table and includes all of the supporting tbody elements around it. Clean and simple.
Where should that piece of code be placed
You need to include it and the jQuery library in the page somehow. You modify the master page, or use a delegate control as I describe here.
I’ve struggled with this. Should be such a simple thing imho. Your solution was almost prefect, but I tweaked it a bit and came up with this…
$(document).ready(
function() {
$(“.ms-listviewtable”).before($(“#Hero-WPQ1”));
return true;
}
);
It does nearly the same as yours, but incorporates it into the top of the listview table and includes all of the supporting tbody elements around it. Clean and simple.