benji87 Posted August 2, 2007 Share Posted August 2, 2007 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 More sharing options...
mainewoods Posted August 4, 2007 Share Posted August 4, 2007 <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" /> --'swanky' and 'groovy' have the same href Link to comment https://forums.phpfreaks.com/topic/63024-switching-style-sheets-problem/#findComment-315299 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.