November 3, 2011
how can I detect page when I compile all javascript to one file
Question by guilin 桂林
I compile all my javascript for different pages into one file, so I have to identify page for my all.js. I can put a hidden element in my pages and let javascript detect this element, but I don’t like this solution, are there any other ways to do this?
Answer by Starx
If you script is based on pages, then compiling them into one script is a bad idea, load the file separately, it will be lighter and definately increase some performace.