jQuery/JavaScript - performance-issue when having a lot of small .js-Files?

i've got a site with a lot of referenced .js-Files; those are rather small files, but I want to keep my methods separated by topic/functionality.

Is it better to keep all the methods in one .js-File or is it no problem to have many (~ 20 - 30) small files all including only some lines?

Answers


By all means keep them separate for development, but you should consider bundling them together into one file for production.

There is a nice discussion at sitepoint.com

For each of these files, an HTTP request is sent to the server, and then the browser awaits a response before requesting the next file. Limits (or limitations) of the browser generally prevent parallel downloads. This means that for each file, you wait for the request to reach the server, the server to process the request, and the reply (including the file content itself) to reach you. Put end to end, a few of these can make a big difference to page load times.


Need Your Help

Python 3 syntax error with def function((x,y))

python function parameters python-3.x python-2.x

So I'm analyzing this code and I have reason to believe this was coded with python 2.X but I'm using 3.2 and would like to convert it so that it would work.

Let ListView scroll to selected item

xaml windows-runtime winrt-xaml

I have a WinRT/C#/XAML app with a view that has a vertical ListView of items. Depending on the amount of items the ListView shows a vertical scrollbar. Here's the XAML definition:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.