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.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Posted Aug 4, 2011, 2:09 PM
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