How to load a JavaScript file using jQuery?

Poster
Posted by Poster under jQuery category on | Views : 4008
To load a JavaScript file using jQuery, write following code

<script type="text/javascript">
// to load and show the success message
$.getScript("poster.js", function(){
alert("Script loaded and executed successfully.");
});

// just to simply load and forget it
$.getScript("poster.js");
</script>

Comments or Responses

Login to post response