Click here to Skip to main content
15,895,256 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi frends,

can you give / help me in loading a javascript in asp.net /mvc.

if the javascript depends on 2 other javascripts.

if they are big scripts, what is the best way to load javascript.

thanks
Posted

1 solution

The question makes little sense: you are not "loading" your JavaScripts to enhance anything, your client's browser downloads all resource from the server and executed the scripts.

I doubt that your problem is great sized of the scripts, but you can improve it only if you learn better programming. You just need to improve your programming skills to write less code which does more and faster.

Only on top of that, you can do some technical tricks that helps you to reduce the size of the scripts. (Again, it has nothing to do with "loading"; you just can reduce the network traffic, which is the real bottleneck. It can pay off if you have really big files.) For that purpose, you can compile script into other script which is compressed but perhaps purely readable. One example of such thing is Google Closure Compiler:
https://developers.google.com/closure/compiler[^],
https://closure-compiler.appspot.com/home[^].

You can find a lot more: http://bfy.tw/CRn[^].

—SA
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 7-Jun-15 10:52am    
All right. Are you going to accept the answer formally?
—SA
Member 9437509 8-Jun-15 12:15pm    
i dont have any issues,

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900