469,915 Members | 2,634 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,915 developers. It's quick & easy.

Is there a way to link style sheets on the flly

Just curious if there is a way to link style sheets on the fly without
having to load two separate versions of a page.
Sep 11 '05 #1
3 1110
JimO said the following on 9/11/2005 4:32 PM:
Just curious if there is a way to link style sheets on the fly without
having to load two separate versions of a page.


Maybe, depending on what you are trying to accomplish.
comp.info.www.authoring.stylesheets is that way =======>

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Sep 12 '05 #2
JimO wrote:
Just curious if there is a way to link style sheets on the fly without
having to load two separate versions of a page.


AFAIK There are at least two ways to do this.

1.)To select a stylesheet per-pageload (session) use document.write()
outside of a function so that it will write as the page is being created
and simply output a string with your '<link rel="stylesheet"
href="'+foo+'" type="text/css">'

2.)To select multiple stylesheets per session
load the files via XMLHTTP , parse them into an MyCSS object and
overwrite the existing CSS memory object's values with those
of the MyCSS object.

NOTE: For Opera support I think one would have to apply the values
of MyCSS individually to the html elements, as the reason I wrote
such code is that Opera's javascript can't *see* CSS stylesheets

--
--.
--=<> Dr. Clue (A.K.A. Ian A. Storms) <>=-- C++,HTML/CSS,Javascript,TCP ...
--`
Sep 12 '05 #3
JimO wrote:
Just curious if there is a way to link style sheets on the fly without
having to load two separate versions of a page.

Example of leading a stylesheet on the fly.
http://www.drclue.net/projects/jsDHT.../OperaCSS.html

--
--.
--=<> Dr. Clue (A.K.A. Ian A. Storms) <>=-- C++,HTML, CSS,Javascript
--=<> http://resume.drclue.net <>=-- AJAX, SOAP, XML, HTTP
--=<> http://www.drclue.net <>=-- SERVLETS,TCP/IP, SQL
--.
Sep 14 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by cruiserweight | last post: by
33 posts views Thread by Thomas Mlynarczyk | last post: by
5 posts views Thread by Dave Mausner | last post: by
29 posts views Thread by jmaxsherkimer | last post: by
6 posts views Thread by JimO | last post: by
9 posts views Thread by Radium | last post: by
1 post views Thread by mscertified | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.