jQuery.getScript loads javascript file before DOM
Using ajax to load my content dynamically. I need to load a javascript
file after I click on a button:
<a id="element" href="http://example.com/test">button</a>
But the script below loads the javascript file before the DOM has been
loaded. How can I solve this?
$("#element").click(function () {
jQuery.getScript("example.com/jsfile.js?ver=0.9");
});
No comments:
Post a Comment