Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

personalize site with css

Status
Not open for further replies.

greatfalls

Technical User
Jul 1, 2001
21
0
0
CA
I am trying to figure out how best to personalize a site using javascript and css. That is when a person comes to my site, depending on where they came from, (will use the document.referrer -for this part) dispaly css 1 vs css2 to certrain tags. I would think there would be an example of this out there. I have seen an example of when a person comes to a site - then choose be selecting a form.

Any Ideas on this would be a big help.
 
Hi

Depends on what control you have over the site. I do this with the server side laguage PHP. I check the referrer and then write out the correct style sheet link accordingly.

Not sure is this is possible using client-side technologies only, but I will investigate further. Does this have to be multi/all browsers? (I have a feeling you can link a style sheet dynamically in IE but not sure about other browsers).

Cheers
Richard
(Johannesburg, Shout Africa)
 
Richard

Thanks for your reply, just doing it on the client side does limit things, but there does seem to be ways out there.

Thanks, (from ottawa, canada)
 
Hi

Did a google search and found this:

document.styleSheets[0].href='zoiets.css';

which will change the first linked stylesheet dynamically.

HTH
Cheers
Richard
 
Thanks Richard, I guess my search was not using the right words.
cheers,
MM
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top