Jump to content

Switching Style Sheets Problem


benji87

Recommended Posts

Hi all. Im working style switching for a new website using css and javascript. I have a script for it from spoono but it just doesnt seem to want to work! When i click the links to change the style it brings up a page cannot be displayed error in both firefox and ie.

 

here is my page code

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="css/default.css" />
<link rel="stylesheet" type="text/css" href="css/alternate.css" title="swanky" />
<link rel="alternate stylesheet" type="text/css" href="css/alternate.css" title="groovy" />
<script type="text/javascript" src="includes/javascript/styleswitcher.js"></script>
</head>

<body>
<p>This text shouls change style when the style changer links are clicked. </p>
<p><a href=”#” onclick=”setActiveStyleSheet(‘swanky’); return false;”>Change style to default</a>
  <a href=”#” onclick=”setActiveStyleSheet(‘groovy’); return false;”>Change style to alternate</a></p>
</body>
</html>

 

My javascript is the styleswitcher.js written by Paul Sowden which is widely used, so i dont believe this is the cause of the problem.

 

Cheers

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.