Modernizr yep - nope; loading javascript separate file combined

I was wondering if it is possible to test if the browser support some features with Modernizr and yepnope and if it is required to load those javascript file it would be automaticaly combined.

E.g.: the test found out that it need to load a.js, b.js and c.js from the server, insted of loading all the 3 js files separately it would combine them into one single file. Is it possible to achieve this kind of functionality?

For clarity, because I’m having trouble understanding what you need:

You want to check, in essence, which of the .js files the client browser is going to have to download, and combine them before download, so that each client only gets one .js download, containing all the stuff they’ll need?

(Not sure I know an answer to this, if so, so someone else pitch in… just trying to get a clear question)

Correct, you are right. I know that it would be possible even without yepnope just using if … else and after testing some browser features it would return an array of file names which will be joined into a string like combine.php?a.js|b.js|c.js etc. Thank you your kindnes.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.