PDA

View Full Version : Loading in css



Elijah
30 Jan 2010, 8:32 AM
Here is a question that has been bugging me for awhile now. Dealing with CSS. When loading in a css file into your page its suppose to be loaded into the page header section. So, if you are in need of css files only if viewing certain pages that the user may or may not be using then what is the best practice to loading in the css file?

I am under the impression that in order to load it into the head tag section that I would need to reload the page completely to do so. Is there an alternative to loading in the external css file into the page header without reloading the page and without loading up all css files that may or may not be used in the session of a user?
Thanks.

30 Jan 2010, 1:42 PM
Look at the following link to do it dynamically - no need to refresh the page:

http://www.javascriptkit.com/javatutors/loadjavascriptcss.shtml