javascript - How to trigger the event manually once the ajax content's script is executed completely? -
i loading html
page script
section(render jquery
ui) via ajax
. html page contains more number widgets. in success function of ajax, accessing ui
controls jquery
ui class names. none of class names added i.e., script not executed. if access same after 100ms using settimeout working.
please refer below code:
var self = this; $.ajax({ url: url, datatype: "html", cache: true, success: function (str,sta,xhr) { $("#samplefile").html(str); settimeout(function() { self.reg($("#samplefile .ui-widgetui")); },100); } });
its working fine want access without settime out. can please suggest on this.
it sounds perhaps trying access dom before initialized. have tried wrapping initialization of ajax request in jquery $(document).ready()
call? makes sure dom in initialized state before getting triggered.
Comments
Post a Comment