I want to use a function on my html page but the content is delivered via ajax, how do I first load the script and then apply the function ? It won’t work if I include the script in my <head> . Also how can I use the jQuery .find() and and apply a function or modify the css for content that has been delivered after the page has loaded ?
I want to use a function on my html page but the content is
Share
LABjs(http://labjs.com/) has an awesome interface for that. Here’s an example code.
In the above example, the
yourfunction();will only be called after the script yourscript.js has been loaded.Edit: After an ajax call using the .load method, this is how your body script might look like.