jquery - Setting focus to a div after replace -


i want shift focus div (#tab2) after location.replace has called function i'm struggling work.

function deleteitem(parent) {         window.location.replace(pagecontext +                 '/delete/item/' +                 $('#itemtabs').tabs( "option", "active" ) + '/' +                 $('#accordion2').accordion( "option", "active" ) + '/' +                 parent.find('.a-itemid').val());     } 

this function deletes item , once has done need redirect page specific div rather refresh whole page. best method work?

try use ajax. jquery has easy understand implementation of ajax. visit this link more information.

you can use way:

var url = pagecontext +           '/delete/item/' +           $('#itemtabs').tabs( "option", "active" ) + '/' +           $('#accordion2').accordion( "option", "active" ) + '/' +           parent.find('.a-itemid').val();  $.ajax({     url: url,     success: function () {         // function called after call has succeeded.     } }); 

Comments