Javascript working on FF but not on IE

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rajesh Rao
    New Member
    • Sep 2006
    • 1

    Javascript working on FF but not on IE

    Hi guys,

    following url works in Fire Fox but not On IE.

    http://www.dell.com/content/topics/topic.aspx/global/hybrid/snp/en/storage_type?c= us&cs=19&l=en&M odelSelection=1 21317&s=dhs




    Code:
    <![CDATA[
    <html>
    <head>
    <title>Storage & Servers</title>
    <style type="text/css">
    body { font-family: arial;
      font-size:9pt; line-height:1.3}
    @media all{
      h1 { font-size:16pt }	
      ul { 
    	margin:.5em 2em 1.4em 0; 
    	padding:0 
    	}
    ul li	{ 
    	margin:0 0 .4em 1.5em;
    	list-style-type:point 
    	}
    }
    #imageDiv { position:absolute;left:430px;top:370px;z-index:0 }
    
    #ContDiv { position:absolute;left:205px;top:100px;z-index:0 }
    	 
    </style>
    <script language="JavaScript">
    
    var width = screen.width;
    var height = screen.height;
    var origWidth, origHeight;
    if (document.layers) {
    	origWidth = window.innerWidth; origHeight = window.innerHeight;
    	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
    }
    
    var page_loaded; 
    function initCont() {
      page_loaded = true; 
      writeImage('imageDiv','ContDiv', origMsg, origImg, ttleMsg); 
    }
    
    
    
    function writeCont(id, sHTML, s1HTML) {
    
      var lay = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
      var cntct = '<table cellspacing="0" cellpadding="5" border="0" width="340" style="border-style:solid;border-color:#efefef;border-width:2px;font-size:9pt;"><tr><td bgcolor="#efefef"><b>'+s1HTML+'</b></td></tr></table><table cellspacing="0" cellpadding="" border="0" width="340" style="border-color:#aaaaaa #eeeeee #eeeeee #eeeeee;border-style:solid solid solid;border-width:3px 2px 2px 2px;font-size:9pt;"><tr valign="top"><td width="340" height="365" style="padding:5px;">' + sHTML + '</td></tr></table>';
      if (typeof lay.innerHTML!="undefined") {
          lay.innerHTML = cntct;
      } else if (document.layers) {
    			lay.document.write(cntct);
    			lay.document.close();
      }
    
    } 
    
    
    function writeImage(id,cntid,sHTML,img,s1HTML) {
    
    //if(navigator.appName == "Microsoft Internet Explorer" || navigator.appName == "Netscape")
    //{
    //	if((navigator.appVersion.indexOf("MSIE") !=-1) || (Number(navigator.appVersion.charAt(0)) >= 4))
    //	{
    //		var indx = navigator.appVersion.indexOf("MSIE");
    //		var ver = Number(navigator.appVersion.substr((indx+5),3));
    //		if(ver >= 6 || (Number(navigator.appVersion.charAt(0)) >= 4))
    //		{
    
      if (!page_loaded) return;
    
      var lay = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
      if (!lay) return;
      
      var imagecnt = '<IMG SRC="'+ img + '" NAME="sub1" WIDTH="100" HEIGHT="100" BORDER="0">';
      if (typeof lay.innerHTML!="undefined") {
          lay.innerHTML = imagecnt;
      } else if (document.layers) {
    			lay.document.write(imagecnt);
    			lay.document.close();
      }
    
    writeCont(cntid, sHTML,s1HTML)
    //		} 
    //	}
    //}
    
    }
    	function getParameter (queryString, parameterName) 
    	{
    		var tempStr = new String(queryString);
    		var parameterName = parameterName + "=";
    		if ( tempStr.length > 0 ) 
    		{
    			var begin = tempStr.indexOf (parameterName);
    			
    			if ( begin != -1 ) 
    			{
    				begin += parameterName.length;
    				end = tempStr.indexOf ( "&" , begin );
    				if ( end == -1 ) { end = tempStr.length }
    				return unescape ( tempStr.substring ( begin, end ) );
    			}
    			return "null";
    		}
    	}
    
    	function go(cat) 
    	{
    		var catid = new String(cat);
    		
    		var qString = window.location;
    		var csName = getParameter(qString,'cs')
    		var sysName = getParameter(qString,'ModelSelection');
    		sysName = sysName +"&category_id="+catid;
    		var writeString;
    		//writeString = "http://accessories.us.dell.com/sna/DellItemsProductListing.aspx?Page=DellItemsProductListing.aspx&spagenum=1&items_per_page=25&image_flag=True&show_summary=True&category_id=5683&ModelSelection=166493&l=en&c=us&cs=19";
    		//writeString = "http://accessories.us.dell.com/sna/DellItemsProductListing.aspx?c=us&l=en&fe=category_id&ModelSelection=166493&cs=19&ManufactSelection=" + sysName;
    		writeString = "http://accessories.us.dell.com/sna/DellItemsProductListing.aspx?c=us&l=en&cs="+ csName + "&ModelSelection=" + sysName;
    		//writeString = "http://accessories.us.dell.com/sna/productlisting.aspx?c=us&cs=19&l=en&s=dhs&k=" + sysName;
    		window.location = writeString;
    	}
    
    
    
    // Variables for Layers
    var origMsg = '<p>Dell branded storage solutions are tested and certified compatible with your Dell PC.</p><p>They will be supported by Dell's award winning technical service and support and covered under the remaining system limited warranty<sup>1</sup>.</p><p>While the third party products we offer are also of excellent quality, service and support for those products are provided by the individual manufacturers.</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>';
    var origImg = 'http://img.dell.com/images/global/shared/storage_hdd_watermark.jpg';
    var ttleMsg = 'Why Buy Dell Storage Devices?';
    
    var dfltMsg = '<p>Dell branded storage solutions are tested and certified compatible with your Dell PC.</p><p>They will be suppoted by Dells award winning technical support and covered under the remaining system limited warranty<sup>1</sup> or one year from date of purchase, whichever is longer.</p><p>While the third party products we offer are also of excellent quality, support and warranty services for those products are provided by the individual manufacturers.</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>';
    var dfltimg = 'http://img.dell.com/images/global/shared/storage_hdd_watermark.jpg';
    
    
    
    
    
    
    
    var msg8 = '<p>A DVD+RW<sup>2</sup> drive brings you the latest in DVD technology.  Use it to store up to 4.7GB on a single layer disk or 8.5GB on dual layer media.  A DVD+RW<sup>2</sup> drive offers you a wide range of usage by reading & recording to DVD+R, DVD+RW<sup>2</sup>, CD-R and CD-RW media.</p><p>A single layer DVD (4.7GB) will hold about:<br/>* 800 MP3 songs, or<br/>* 120 minutes of MPEG video, or<br/>* 2800 Digital Photos (2.4Mpixel), or<br/>* 200 Digital Photos (6Mpixel)</p><p>For more information review the <a href="http://www1.us.dell.com/content/learnmore/learnmore.aspx?c=us&l=en&s=gen&~id=storage_sitelet&~mode=popup" target="_blank"> storage glossary.</a></p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>';
    var img8 = 'http://img.dell.com/images/global/shared/storage_ext_dvdrw.jpg';
    var ttleMsg8 = 'What is an External DVD-RW?';
    
    
    </script>
    
    </head>
    <body onload="initCont()">
    
    <br><br/>
    <font size="2">
    <div>List of storage types:</div>
    <br><b>Disk Drives</b><br/>
    <img src="http://img.dell.com/images/global/brand/ui/secondary.gif" width="4" height="17"> <a onclick="go('5694');" style="cursor:hand" onmouseover="writeImage('imageDiv','ContDiv', msg1, img1, ttleMsg1)">Hard Disk Drives</a><br/>
    <img src="http://img.dell.com/images/global/brand/ui/secondary.gif" width="4" height="17"> <a onclick="go('5693');" style="cursor:hand" onmouseover="writeImage('imageDiv','ContDiv', msg2, img2, ttleMsg2)">Floppy Disk Drives</a><br/><br/>
    
    <b>Compact Disk (CD) </b><br/>
    <img src="http://img.dell.com/images/global/brand/ui/secondary.gif" width="4" height="17"> <a onclick="go('5684');" style="cursor:hand" onmouseover="writeImage('imageDiv','ContDiv', msg3, img3, ttleMsg3)">CD-ROM (internal &amp; external)</a><br/>
    <img src="http://img.dell.com/images/global/brand/ui/secondary.gif" width="4" height="17"> <a onclick="go('5686');" style="cursor:hand" onmouseover="writeImage('imageDiv','ContDiv', msg4, img4, ttleMsg4)">Internal CD-RW</a><br/>
    <img src="http://img.dell.com/images/global/brand/ui/secondary.gif" width="4" height="17"> <a onclick="go('5687');" style="cursor:hand" onmouseover="writeImage('imageDiv','ContDiv', msg5, img5, ttleMsg5)">External CD-RW</a><br/>
    
    <br/><b>Digital Video Disc (DVD)</b><br/>
    
    <img src="http://img.dell.com/images/global/brand/ui/secondary.gif" width="4" height="17"> <a onclick="go('5721');" style="cursor:hand" onmouseover="writeImage('imageDiv','ContDiv', msg6, img6, ttleMsg6)">DVD-ROM (internal &amp; external)</a><br/>
    <img src="http://img.dell.com/images/global/brand/ui/secondary.gif" width="4" height="17"> <a onclick="go('6206');" style="cursor:hand" onmouseover="writeImage('imageDiv','ContDiv', msg7, img7, ttleMsg7)">Internal DVD-RW</a><br/>
    <img src="http://img.dell.com/images/global/brand/ui/secondary.gif" width="4" height="17"> <a onclick="go('6207');" style="cursor:hand" onmouseover="writeImage('imageDiv','ContDiv', msg8, img8, ttleMsg8)">External DVD-RW</a><br/>
    <br/><b>External Storage</b><br/>
    <img  src="http://img.dell.com/images/global/brand/ui/secondary.gif" width="4" height="17"> <a onmouseover="writeImage('imageDiv','ContDiv', msg1, img1, ttleMsg1)" style="CURSOR: hand" onclick="go('5708');">Pocket Drives</a><br/>
    <img  src="http://img.dell.com/images/global/brand/ui/secondary.gif" width="4" height="17"> <a onmouseover="writeImage('imageDiv','ContDiv', msg1, img1, ttleMsg1)" style="CURSOR: hand" onclick="go('5722');">Portable Drives (2.5")</a><br/>
    
    
    <br/><br/><br/>
    </font>
    <div id="imageDiv">
    </div>
    <div id="ContDiv">
    </div>
    
    
    </body>
    </html>
    
    ]]>
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Unless you work for Dell, ask them to fix it.

    The code is messy and the div appears in the wrong place. The correct CSS setting for cursor is "pointer", not "hand".

    Comment

    Working...