Wednesday, January 28, 2015

Call JavaScript Function in One File from Another JavaScript File



Scripts/Hello.js 

   function HelloWorld() { 
        //print Hello World 
        $("#UserMessage").html("Hello World"); 
    }   



Now we have to call it in another JavaScript File 


Scripts/Activity.js
 
$.getScript('/Scripts/Hello.js', function () {         
      HelloWorld(); 
});


0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More