emmontenegro Posted February 24, 2015 Share Posted February 24, 2015 I have a function on load below: ;(function(window, jQuery, undefined) { })(window, jQuery); My question is, I want to trigger the function above again after ajax success How can I do that? Link to comment https://forums.phpfreaks.com/topic/294871-trigger-a-function-again-after-ajax-success/ Share on other sites More sharing options...
CroNiX Posted February 24, 2015 Share Posted February 24, 2015 Create a named function instead of an anonymous one. Then just call it with your load function and also your ajax success callback. Link to comment https://forums.phpfreaks.com/topic/294871-trigger-a-function-again-after-ajax-success/#findComment-1506633 Share on other sites More sharing options...
rwhite35 Posted February 25, 2015 Share Posted February 25, 2015 Also look at the promise interface which is similar to an after expression in looping constructs. $.ajax({ //do some stuff here }) /* promise interface */ .done (function(data) { //do some other stuff }); Link to comment https://forums.phpfreaks.com/topic/294871-trigger-a-function-again-after-ajax-success/#findComment-1506707 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.