Jump to content

How to Redirect when browser is IE6 or CHROME ?


Yammaski

Recommended Posts

I want to make a "redirect-page" to sent the user to page A or page B.Most users will be directed to the "normal" page A.But if the user's browser is IE6 or Google Chrome, he has to be directed to page B.The use of this is because there's an issue with those browsers on that certain page and I can't find another solution.You can visit the testpage here !The testpage will work normal, except with IE6 or Chrome.Page A : page with the black image that swaps to the colored frogs.Page B : page without that black image swap

Link to comment
Share on other sites

Have you tried validating your page first? It may have an effect on Chrome...

Link to comment
Share on other sites

Actually, I meant the HTML validator. You had 30 errors, but I see you've fixed them.I played around with the JavaScript, and found nothing... not surprisingly, the error was not in the JavaScript... it appears to be in some kind of a quirk with the WebKit CSS engine... I'm not sure exactly what. Maybe something :hover related.To solve the issue, I just removed your second image, and made your other one be swapped onmouseover, and restored onmouseout, similarly to what you do with everything else. The CSS is also cleaned up. I added text-decoration:none; to fix the underline that appears on WebKit under any links, regardless of the display:block; setting.(Two WebKit bugs in one post... it's funny how this time IE and everyone else is doing it properly)

<!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=utf-8" /><title></title><style type="text/css">#swap a {	border:none;	display:block;	text-decoration:none;}</style><script type="text/javascript"><!--function MM_preloadImages() { //v3.0 	var d=document;	if(d.images){		if(!d.MM_p) d.MM_p=new Array();		var i,j=d.MM_p.length,a=MM_preloadImages.arguments;		for(i=0; i<a.length; i++)			if (a[i].indexOf("#")!=0){				d.MM_p[j]=new Image;				d.MM_p[j++].src=a[i];			}	}}function MM_swapImgRestore() { //v3.0  var i,x,a=document.MM_sr;  for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)	  x.src=x.oSrc;}function MM_findObj(n, d) { //v4.01	var p,i,x;  if(!d) d=document;	if((p=n.indexOf("?"))>0&&parent.frames.length) {		d=parent.frames[n.substring(p+1)].document;		n=n.substring(0,p);	}	if(!(x=d[n])&&d.all) x=d.all[n];	for (i=0;!x&&i<d.forms.length;i++)		x=d.forms[i][n];	for(i=0;!x&&d.layers&&i<d.layers.length;i++)		x=MM_findObj(n,d.layers[i].document);	if(!x && d.getElementById)		x=d.getElementById(n);	return x;}function MM_swapImage() { //v3.0	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array;	for(i=0;i<(a.length-2);i+=3)		if ((x=MM_findObj(a[i]))!=null){			document.MM_sr[j++]=x;			if(!x.oSrc)				x.oSrc = x.src;			x.src=a[i+2];		}}//--></script></head><body onload="MM_preloadImages('../images/Color_JPGs/Sun-Yellow-211.jpg','../images/Color_JPGs/Golden-Yellow-020.jpg','../images/Color_JPGs/Light-Yellow-022.jpg','../images/Color_JPGs/Dark-Red-030.jpg','../images/Color_JPGs/Light-Red-032.jpg','../images/Color_JPGs/Orange-034.jpg','../images/Color_JPGs/Bordeaux-048.jpg','../images/Color_JPGs/Light-Violet-403.jpg','../images/Color_JPGs/Telemagenta-077.jpg','../images/Color_JPGs/Soft-Pink-045.jpg','../images/Color_JPGs/Steel-Blue-518.jpg','../images/Color_JPGs/Striking-Blue-593.jpg','../images/Color_JPGs/Traffic-Blue-057.jpg','../images/Color_JPGs/Ice-Blue-056.jpg','../images/Color_JPGs/Turquoise-054.jpg','../images/Color_JPGs/Dark-Green-060.jpg','../images/Color_JPGs/Grass-Green-068.jpg','../images/Color_JPGs/Yellow-Green-064.jpg','../images/Color_JPGs/Brown-080.jpg','../images/Color_JPGs/Dark-Grey-073.jpg','../images/Color_JPGs/Telegrey-076.jpg','../images/Color_JPGs/Light-Grey-072.jpg','../images/Color_JPGs/White-010.jpg','../images/Color_JPGs/Black-070.jpg','../images/Color_JPGs/Silver-Grey-090.jpg','../images/Color_JPGs/Gold-930.jpg','../images/Color_JPGs/Anthracite-093.jpg','../images/Color_JPGs/Graphite-932.jpg')"><table width="430" border="0" cellpadding="0">  <tr>	<td><div id="swap"> 	<a href="#"><img src="../images/Color_JPGs/Frog_Eyes.jpg" title="" name="stickerskleuren" width="430" height="430" border="0" usemap="#stickerskleurenMap" id="stickerskleuren" alt="" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Frog_Color.jpg',1)" onmouseout="MM_swapImgRestore()" /><map name="stickerskleurenMap" id="stickerskleurenMap">			  <area shape="poly" coords="118,47,116,53,112,53,112,69,115,85,121,99,125,101,127,97,128,90,135,103,141,116,150,127,160,139,169,147,184,147,192,146,189,151,187,159,190,165,197,166,201,163,194,160,194,154,198,148,203,144,193,143,183,142,174,134,163,117,156,101,151,87,147,78,146,85,143,89,138,83,134,74,131,71,128,65,129,59,131,55,130,53,125,55,123,52,124,47,123,44" title="RGB 255,210,0" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Sun-Yellow-211.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />			  <area shape="poly" coords="136,77,139,84,144,89,146,83,148,77,157,102,169,126,183,142,196,143,203,143,198,149,195,158,202,164,216,162,227,158,232,153,233,149,236,140,230,140,227,138,221,141,219,136,210,127,200,122,207,118,210,111,216,115,224,119,230,113,233,100,237,97,242,96,243,93,237,90,235,82,226,83,225,88,222,89,227,93,223,103,217,99,208,97,197,82,194,60,195,53,191,47,183,48,177,48,171,42,170,38,173,35,179,30,173,27,158,25,152,25,153,34,165,46,160,67,151,52,154,46,154,43,151,37,145,34,144,40,138,41,136,58" href="#" title="RGB 255,182,0" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Golden-Yellow-020.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />			  <area shape="poly" coords="192,167,186,159,191,148,169,147,154,134,138,111,129,92,126,98,123,100,114,89,106,80,107,71,103,69,98,66,94,68,92,72,90,77,93,94,101,111,108,115,109,104,118,114,132,131,142,141,160,153,181,150,179,162,183,169" href="#" title="RGB 255,230,0" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Light-Yellow-022.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />			  <area shape="poly" coords="184,170,178,165,179,158,180,153,167,154,158,154,146,147,125,128,115,112,109,105,110,116,107,116,100,112,97,107,87,98,86,89,81,90,78,85,74,85,72,90,69,94,74,112,85,130,95,134,93,120,104,132,123,148,146,162,159,162,172,155,172,164,173,172,179,174" href="#" title="RGB 139,16,26" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Dark-Red-030.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />			  <area shape="poly" coords="179,176,172,174,169,167,172,156,163,162,153,163,140,160,126,151,108,136,94,123,95,129,94,135,86,131,83,127,72,121,68,118,68,113,63,111,58,106,55,106,53,112,56,115,51,118,59,132,68,144,75,151,83,153,83,148,80,141,88,148,107,159,123,168,139,173,152,171,159,166,163,164,165,169,165,176,171,181" href="#" title="RGB 203,23,3" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Light-Red-032.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />			  <area shape="poly" coords="173,182,167,180,164,173,162,165,155,170,144,173,133,172,115,164,99,156,89,148,81,142,84,149,82,154,77,153,71,150,59,145,55,143,53,135,48,136,44,133,40,133,39,137,43,141,40,143,39,144,48,157,61,170,70,174,76,173,73,169,71,163,82,168,98,175,115,181,129,184,140,184,147,179,156,172,158,173,159,180,162,186,168,187" href="#" title="RGB 239,86,0" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Orange-034.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />			  <area shape="poly" coords="169,188,161,188,158,182,158,172,152,176,147,181,141,185,131,185,115,181,91,173,72,164,72,168,76,174,69,175,62,171,47,168,43,163,39,162,33,160,30,161,30,164,33,169,30,171,39,183,52,192,61,196,70,197,71,192,63,184,70,187,83,191,105,196,120,199,135,197,143,190,152,181,153,187,158,194,165,193" href="#" title="RGB 105,0,46" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Bordeaux-048.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />			  <area shape="poly" coords="167,194,159,197,152,191,151,183,137,197,131,199,121,199,103,196,80,191,64,186,69,191,71,197,62,198,56,195,41,195,36,189,33,190,28,188,24,191,24,194,28,198,25,201,37,210,50,217,62,221,71,219,62,209,70,210,86,213,106,213,123,213,138,206,142,197,146,191,149,197,154,203,159,203,163,199" href="#" title="RGB 89,44,135" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Light-Violet-403.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />			  <area shape="poly" coords="164,201,158,205,150,200,146,193,138,205,131,211,116,214,97,213,80,213,64,210,67,216,70,220,62,221,55,221,40,221,35,216,31,219,24,218,23,221,29,227,26,229,38,237,56,243,69,243,73,240,64,234,80,233,103,231,120,228,133,221,141,209,144,201,148,208,155,213,162,209" href="#" title="RGB 192,44,110" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Telemagenta-077.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />			  <area shape="poly" coords="162,211,156,213,150,210,145,202,139,213,131,224,114,230,95,233,67,234,70,237,74,241,63,244,45,249,38,244,36,247,29,247,25,253,32,256,32,259,46,265,68,267,79,263,66,256,87,253,107,248,126,240,138,232,142,211,148,217,157,221,162,217" href="#" title="RGB 233,127,180" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Soft-Pink-045.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />			  <area shape="poly" coords="163,218,157,221,150,219,142,212,138,231,123,241,100,250,79,254,67,256,78,262,75,267,61,269,52,274,44,271,38,276,38,281,40,286,55,291,71,290,86,288,89,283,76,278,92,273,114,264,136,252,144,238,145,227,145,221,151,229,159,230,163,226" href="#" title="RGB 13,23,61" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Steel-Blue-518.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />			  <area shape="poly" coords="165,227,158,231,152,229,145,222,145,234,139,249,122,260,99,271,79,278,87,281,88,286,75,291,64,298,56,297,51,302,48,308,53,309,56,313,75,313,92,309,102,300,91,299,87,298,101,292,119,281,137,270,147,255,151,244,150,232,154,237,160,239,165,234" href="#" title="RGB 12,34,140" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Striking-Blue-593.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />			  <area shape="poly" coords="166,232,162,238,156,239,151,235,150,245,147,254,136,269,126,277,112,287,97,294,89,297,101,299,97,306,89,312,79,321,72,320,68,325,64,331,69,333,72,333,72,336,86,336,101,330,111,327,118,316,104,317,117,307,135,291,146,279,153,269,153,259,151,246,158,247,167,247,169,239" href="#" title="RGB 0,80,147" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Traffic-Blue-057.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />			  <area shape="poly" coords="168,237,167,245,162,248,153,246,151,249,153,265,151,275,139,286,128,298,116,307,107,315,116,316,116,320,112,327,107,329,97,341,89,341,88,346,84,349,85,355,91,354,93,357,103,355,118,349,129,340,134,331,121,333,130,323,143,308,156,291,163,276,161,265,154,253,162,255,172,254,174,245" href="#" title="RGB 55,161,212" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Ice-Blue-056.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />			  <area shape="poly" coords="175,246,173,253,168,256,160,255,156,254,160,264,163,276,158,289,145,305,135,319,122,332,133,331,133,334,128,343,120,356,112,359,110,364,105,369,108,373,115,369,118,373,131,367,144,359,151,349,152,342,141,345,152,330,161,314,170,295,173,283,169,272,163,263,169,261,178,260,180,252" href="#" title="RGB 0,155,151" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Turquoise-054.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />			  <area shape="poly" coords="181,251,180,258,175,262,166,263,170,273,173,285,168,303,159,320,149,335,143,344,151,343,153,344,149,354,146,364,142,370,135,377,135,385,143,382,143,387,157,379,167,368,174,360,175,350,163,353,168,343,175,327,184,304,185,287,177,275,174,266,187,267,187,256" href="#" title="RGB 0,70,39" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Dark-Green-060.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />			  <area shape="poly" coords="188,257,188,265,185,268,176,269,178,276,182,283,185,292,184,303,177,324,170,341,165,353,170,351,174,351,174,359,171,365,168,378,161,383,162,387,158,393,162,397,169,394,171,397,183,385,192,374,197,361,195,354,186,361,192,345,196,326,199,306,198,292,188,283,182,275,190,272,196,265,194,259" href="#" title="RGB 0,122,66" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Grass-Green-068.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />			  <area shape="poly" coords="196,260,196,267,192,272,185,275,187,280,193,285,198,293,199,306,196,329,193,341,187,360,194,356,198,356,196,367,195,383,188,391,192,393,187,400,191,403,194,401,198,398,201,400,211,386,219,369,219,356,210,364,212,345,212,316,210,300,205,290,197,283,190,279,198,276,203,269,202,264" href="#" title="RGB 140,210,40" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Yellow-Green-064.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />			  <area shape="poly" coords="201,262,203,269,199,276,193,279,199,285,206,292,212,301,214,320,213,335,212,349,210,362,215,357,219,356,221,363,220,380,223,385,216,390,218,394,216,402,221,406,226,399,228,401,237,391,241,377,244,362,240,353,234,362,232,350,231,329,227,306,221,292,211,287,202,281,208,277,213,270,209,263" href="#" title="RGB 68,41,30" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Brown-080.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />			  <area shape="poly" coords="210,263,214,270,210,275,204,280,213,288,223,295,229,311,230,334,232,349,233,360,237,357,241,353,244,361,242,373,248,374,249,382,245,387,247,393,246,398,252,400,255,393,258,397,262,388,266,373,268,357,265,350,261,348,256,357,253,342,248,320,240,299,234,291,225,287,213,283,217,278,222,271,217,264" href="#" title="RGB 76,78,79" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Dark-Grey-073.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />			  <area shape="poly" coords="219,264,222,270,220,276,215,282,220,285,228,287,237,295,245,314,251,334,256,357,260,350,265,348,267,358,273,372,272,379,273,383,275,391,281,391,282,384,286,386,290,372,291,357,288,346,282,338,278,349,273,331,262,309,252,293,245,286,234,284,223,282,228,277,230,266,224,262" href="#" title="RGB 175,170,170" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Telegrey-076.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />			  <area shape="poly" coords="226,263,230,266,230,272,228,277,224,282,239,284,246,286,259,303,268,320,274,333,278,349,281,342,284,337,289,344,290,349,298,362,296,370,301,372,302,378,309,379,309,373,313,372,314,357,312,341,307,330,300,326,299,337,289,319,275,298,263,285,256,279,246,279,234,280,237,275,239,266,233,261" href="#" title="RGB 235,235,235" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Light-Grey-072.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />			  <area shape="poly" coords="232,260,237,262,239,268,238,274,234,279,245,279,257,279,273,296,286,314,299,336,300,326,303,326,309,334,320,346,321,351,322,356,325,357,326,364,333,363,333,356,337,356,336,343,332,329,326,317,318,311,318,323,305,309,285,286,270,274,257,273,243,276,246,267,247,260,241,257" href="#" title="RGB 255,255,255" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/White-010.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />			  <area shape="poly" coords="238,257,245,259,247,264,245,270,244,276,254,274,266,273,275,277,287,287,298,298,305,309,312,318,317,323,317,313,320,310,326,317,339,328,341,333,344,337,350,343,355,342,355,337,357,336,352,318,345,303,338,295,331,292,333,304,323,295,307,281,288,268,277,263,267,264,254,270,254,262,253,254,244,251" href="#" title="RGB 0,0,0" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Black-070.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />			  <area shape="poly" coords="246,251,253,253,256,258,255,268,261,267,268,263,278,263,290,269,303,279,317,290,332,301,330,296,332,291,336,294,343,299,351,304,358,307,361,316,365,316,368,321,374,319,370,311,374,307,368,296,358,283,346,273,342,273,345,285,327,272,308,261,289,253,276,255,265,263,262,254,259,246,253,245" href="#" title="metallic" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Silver-Grey-090.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />			  <area shape="poly" coords="251,244,257,244,262,249,264,257,265,261,274,256,283,252,296,255,316,266,330,274,346,285,341,277,344,272,352,277,371,283,377,291,383,297,387,291,383,285,385,279,374,266,364,257,354,251,350,253,355,263,341,257,322,249,304,244,289,242,279,246,269,256,268,248,264,239,259,239" href="#" title="metallic" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Gold-930.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />			  <area shape="poly" coords="260,231,267,230,272,235,275,242,281,237,287,230,293,227,305,228,323,228,338,233,353,236,359,238,356,235,354,229,360,228,367,229,373,231,385,231,388,237,393,235,401,240,403,235,403,233,398,229,400,225,386,214,373,208,362,207,356,208,359,212,363,217,354,216,338,214,315,214,300,215,289,220,285,226,278,236,276,231,272,224,264,224" href="#" title="metallic" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Graphite-932.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />			  <area shape="poly" coords="254,239,258,233,265,231,272,236,275,245,281,236,289,229,309,228,327,230,348,236,361,240,357,236,355,229,365,229,380,238,394,249,397,256,395,258,397,261,397,266,393,269,388,263,385,261,382,261,375,255,360,253,353,250,349,253,353,262,342,257,327,250,313,246,299,244,285,243,279,246,270,254,268,248,262,240" href="#" title="metallic" onmouseover="MM_swapImage('stickerskleuren','','../images/Color_JPGs/Anthracite-093.jpg',1)" onmouseout="MM_swapImgRestore()" alt="" />		  </map></a> </div></td>  </tr></table></body></html>

Link to comment
Share on other sites

This works on Chrome, but as you can see, the rest of the colors basically become invisible. This is because you swap the whole image with the whole image, not part of the image for a part of the image.So, regardless of whether this starts to work in IE and the rest, it will still probably not be what you want. So why not revert to the above?

Link to comment
Share on other sites

I've tested that in all of the top 5 browsers (IE8, FF3.6, O10.5, S4, C4), and it works equivalently in all of them. Where's the fault in Chrome that you see?

Link to comment
Share on other sites

I've tested that in all of the top 5 browsers (IE8, FF3.6, O10.5, S4, C4), and it works equivalently in all of them. Where's the fault in Chrome that you see?
Maybe you're missing something ... when onmouse-over on a color, there has to appear a frog in that color in the right above corner. As long you keep the cursor there, the frog must be shown.See attach for "light red" :light%20red.JPGSummary :This is working in Chrome4 & FF3.6, but not in IE6 & IE8 :OK FOR C4 & FF3.6This is working IE8 & FF3.6, but not IE6 & Chrome4 :OK FOR IE8 & FF3.6And this is working in all browsers (IE7 & Safari ?), here I deleted the black swap :) :FOR ALL BROWSERSEDIT :I made a "redirect-page", now my issue is solved. Except Safari ?This link should work for all browsers
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...