Hello,
I have two .js file when i click on Add button then a.js file is load
when click on view then b.js file is load in asp.net.
How it is possible.
Please help me.
How to call .js file in button click event
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Posted Aug 4, 2011, 10:09 AM EDT
You can use Jquery.getScript method to load the javascript on demand.
http://api.jquery.com/jQuery.getScript
$.getScript('ajax/test.js', function(data, textStatus)
{
console.log(data); //data returned
console.log(textStatus); //success
console.log('Load was performed.');
});
If you don't want to use jquery then refer the below urls.
http://www.javascriptkit.com/javatutors/loadjavascriptcss.shtml
http://ntt.cc/2008/02/10/4-ways-to-dynamically-load-external-javascriptwith-source.html
http://www.ejeliot.com/blog/109