currently I have different javascript onload commands for each of my web pages. Is it possible to compile all of them in one javascript file and assign the functions to a specific web page? I'm currently working with an ASP.net MVC project, so I load a Layout.html when I start my application. I guess what I want is to only have a single javascript file and load it in my layout.html, and when I open another page a specific javascript function will run.
-
How about making separate function for every webpage and attach it to <body onLoad="function"> ? This way whole javascript can stay in one file.patrykf– patrykf2014-08-26 10:26:07 +00:00Commented Aug 26, 2014 at 10:26
-
Without seeing a specific example of your code i.e. the way you are onloading at the moment, it is tricky to advise precisely -- stackoverflow.com/help/how-to-askPebbl– Pebbl2014-08-26 10:35:51 +00:00Commented Aug 26, 2014 at 10:35
Add a comment
|