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
https://forums.phpfreaks.com/topic/63024-switching-style-sheets-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.