473,651 Members | 2,670 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1178
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.javas cript 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2089
by: cruiserweight | last post by:
i am trying to serve the exact same page from both http and https servers. i am using a linked stylesheet like this <link rel="stylesheet" href="../styles/main.css" type="text/css" /> the http server works exactly like expected, just fine. but if you switch to https the linked stylesheets stop working and you receive an unstyled page. try for yourself here (styles broken)
33
27734
by: Thomas Mlynarczyk | last post by:
Hi, I'm looking for a way to put a 1px solid border around the image in this link: <a href="some.html"><img src="some.gif"></a> Well, that, by itself, is simple. However, I would like to have a different border color for a mouse hover effect over the image. With Mozilla, I can simply specify img:hover {...}, but IE allows hover only for <a>. So now I'm looking for a way to set the border for my <a> element rather than the <img>, but...
5
2517
by: Dave Mausner | last post by:
the html 4.01 standard says i can use: <link type="text/css" href=file-name> to include a style section. questions: 1. does the external style sheet have to contain <html> ... </html>? 2. does it have to contain <style> ... </style>? 3. is <link> recognized within html page <style>? 4. is the <link href> a relative url, i.e., just a file name, or must it be fully qualified?
0
5671
by: Andrea | last post by:
Hi everyone. I'm working on a navigation menu (in a frameset) that I want to set the "active" link to black (the link that corresponds to the page displayed in the right side of the frame) to black. http://www.personal.psu.edu/axg251/wc In the original external style sheet, I set the a:link, a:visited, a:active, and a:hover. That works fine. In the navigation page, I call a function for onclick - it sets the
29
49046
by: jmaxsherkimer | last post by:
the site we're working on has some anchor links, you click them they scroll to the bottom of the page with the answers to the questions linked on to. is there anyway to make it so that the links are not underlined when the page loads, when the user moves the mouse over it's underlined, mouse out no underline. i tried: <a href="#section14" class="drkblue08bold" style="text-decoration:none"> but that left the underline gone forever,...
6
3770
by: JimO | last post by:
Is there any way to reset a link's state. In other words reset a visited link to an unvisited link. I guess the question I'm asking would be how do you programatically search and clear the history of a particular page?
5
1896
by: kjmatthews | last post by:
I am designing a site but only have access to a Mac, equipped with Virtual PC. On IE6 is appears that, on some pages of this site, the navigation does not appear. I have put up a test case: http://digitalovertone.com/examples/iedisappear.html. I have stripped most of the irrelevant CSS from this page. Please observe: on loading the page, the navigation and the words "some text" should appear in the left column. They do not (at least on...
9
2020
by: Radium | last post by:
Cascading Style Sheet is an extreme hazard to your privacy. It allows others on the internet to see your monitor and files. It allows them to copy images on your monitor to their computers. It also allows them to copy files from your computer to their's. It is dangerous. Avoid at all costs. CSS that isn't stored in the victim's computer. Instead it is stored in the perpetrator's PC. What it does is it reads everything on the victim's...
1
1691
by: mscertified | last post by:
Can anyone explain how references to style sheets work, I've exhausted looking in help, its all so confusing. I have three style sheets in my project under 'Style Sheets'. Only the first style sheet seems to work. If I refer to a class in one of the other two, I do not get the formatting. Why? How do these style sheets work if I also refer to external style sheets and how do I refer to multiple external style sheets? Should I be using...
0
8275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8802
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8697
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8465
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8579
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7297
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6158
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4283
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1909
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.