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? Quote 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. Quote 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 (edited) 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 }); Edited February 25, 2015 by rwhite35 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.