Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 2680 | Replies: 4
![]() |
•
•
Join Date: Apr 2006
Location: Australia
Posts: 10
Reputation:
Rep Power: 3
Solved Threads: 0
Hello there, I need my page to randomly select a CSS document. I don't want the user to select it, but instead to do it when the page loads.
This is the script I have so far:
This function does write the proper <style> tag, but it does not work. :evil: When I go to "view source", I don't see the line that suppously was written by the JS function.
PLEASE HELP!!:-|
This is the script I have so far:
<script language="javascript" type="text/javascript">
var ranNum= Math.floor(Math.random()*3+1);
document.write("<link rel='stylesheet' href='hd"+ranNum+".css' type='text/css'>");
</script>This function does write the proper <style> tag, but it does not work. :evil: When I go to "view source", I don't see the line that suppously was written by the JS function.
PLEASE HELP!!:-|
•
•
Join Date: Feb 2006
Posts: 49
Reputation:
Rep Power: 3
Solved Threads: 1
•
•
•
•
When I go to "view source", I don't see the line that suppously was written by the JS function.
Site admin at NetBulge.com, a place set out to improve the web 1 good article at a time :)
•
•
Join Date: Apr 2006
Location: Australia
Posts: 21
Reputation:
Rep Power: 3
Solved Threads: 0
•
•
•
•
I need my page to randomly select a CSS document. I don't want the user to select it, but instead to do it when the page loads.
█ WeLoveCSS.com • XHTML/CSS Forum for beginners to advanced users
Can't find any good CSS Forums? WLC is the right place for you!
Can't find any good CSS Forums? WLC is the right place for you!
•
•
Join Date: Apr 2006
Location: Australia
Posts: 10
Reputation:
Rep Power: 3
Solved Threads: 0
Me again, sorry for the late response, it was the weekend.
I don't want the user to select the a CSS and then refresh the page. I want to do that for them.
The way I have setup my page is that I have one CSS for the whole page: styles.CSS, and then I have 3 other CSS documents (hd1.css, hd2.css, hd3.css) that I want to use them in the document randomly.
Here is the page
http://www.arch.usyd.edu.au/~jrui0688/template.htm
(this is the testing page).
I don't want the user to select the a CSS and then refresh the page. I want to do that for them.
The way I have setup my page is that I have one CSS for the whole page: styles.CSS, and then I have 3 other CSS documents (hd1.css, hd2.css, hd3.css) that I want to use them in the document randomly.
Here is the page
http://www.arch.usyd.edu.au/~jrui0688/template.htm
(this is the testing page).
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)






Linear Mode