I would like to know what are some downsides using too much JavaScript code in a web page?
For example, I will use a jQuery framework for my dropdown menus, tabs and accordion. And other JavaScripts for my calendar (even-though there is available calendar that uses jQuery) and other JavaScript for other stuff? What is the effect? (My opinion is conflicting of JavaScript and heavy to load)
I know a lot of developers that masters more than 2 JavaScript frameworks. My question is: When developing a project how do you pick a JavaScript framework for that project? Why will you use MooTools or jQuery for that project? (I know that is a matter of choice), but is there other reason? Like mootools is good for this... or jQuery is good for that..
I want to hear you opinion.
It will depend on the browser (and back end) and how it performs /scales to many scripts. When developing a solution think about the audience's requirements first. Are they going to be running quad core monsters on super fast fibre optic links or small phones with a GPRS links. Then decide what technologies will fill those needs.
Don't start from the technology first.
Network overhead. I'm not speaking about the scripts themselves, but about what they are doing:
Many plug-ins create frames to pull content from third party websites: Facebook like buttons, comments, Twitter feed, Google and various kind of ads, etc. And moreover these plugins may load and run their own script stuff too.
Even if you have 8 cores, the website content is jumping around for at least 30 seconds as plugins load their content (on every page visit!). That's why I installed browser plugins to block javascript for good. But even if I enable them it's common that they pull scripts from at least 20-30 domains, and I need to enable all scripts on the page 4-5 times to make the site fully functional. Please avoid creating situations like this.
From your question, a couple of issues come to mind:
In terms of choosing a single framework, look at what you're trying to do -- some frameworks will better suit some sites than others. Also look at the skillsets your developers already have, as the less new stuff they have to learn, the more time they can spend building your site. Look at the community around the framework. Consider the availability of plug-ins (although there are a lot of low-quality plug-ins out there; don't judge by quantity alone). Look at whether the API of the framework sits well with your approach to things.
What are some downside using to many JavaScripts in a website?
Why will you use MooTools or jQuery for that project?
This is not just a matter of personal taste. Check out this question for more details.
There are specific frameworks out there for specific things--Take Ext JS for example, which tries to encompass everything a site needs. This is not what jQuery does.
Don't also forget that some users may have Javascript disabled, so having some of the required features of the website (ie menus, navigation, forms etc) JS based will result for those users to be unable to view your site.
Using a lot of JavaScript files shouldn't be a problem since you can always merge them all together to minimize HTTP requests. Of course to execute all that JavaScript it takes browser's time. There's also chance that there will be conflicts between all those JS libraries/plugins or within DOM.
As for choosing the right library it really depends on what kind of site/application you are making. If you just want to use pre-made plugins then there's isn't a big difference which library you use and you should just chose the one which has more of the plugins you want to use and I'm quite sure that jQuery is the best choice here since it has the most plugins overall.
From other hand if you want to write your own components/plugins/code then you should test each of them out and see which one suits your coding style and project the best. For example a while ago I found Prototype suits my taste better and is quite nice for big JS heavy projects. But jQuery has gone a long way since then so I'd probably try each of the most popular libraries out if I had to make a new project.