javascript - Updating JQueryUI .button() when called again? -


i have post returns new page. page has <a> link </a> upon pages return call $( "a" ).button();. have called on original page of buttons formatted jqueryui button. however, new button isn't formatted until make post. there way

$(".maprelation")         .click(function( event ) {         var closestrow = $(this).closest("tr");         var nextrow = closestrow.next("tr");         $(this).css("display", "none");         if(nextrow.attr("id") != "map"){             $.ajax({                 url: "addtask.aspx/insertmappingrow",                 type: "post",                 datatype: "json",                 contenttype: "application/json; charset=utf-8",                 success: function (res) {                      closestrow.after(res.d);                      },                 error: function (res) { debugger; alert("error"); }                 });                 $("#effect").height("+=25");                 $("#toggler").height("+=25");         }         $(".submitmapping").button(); 

i wrote entire question , colleague answered me maybe it'll else...

the $(".submitmapping").button(); needs placed in success portion of ajax call. since ajax asynchronous, .button() happening before new button on page. if place $(".submitmapping").button(); after closestrow.after(res.d); call when it's been placed on page.


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -