By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,605 Members | 2,137 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,605 IT Pros & Developers. It's quick & easy.

Javascript working on FF but not on IE

P: 1
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&ModelSelection=121317 &s=dhs




Expand|Select|Wrap|Line Numbers
  1.  
  2. <![CDATA[
  3. <html>
  4. <head>
  5. <title>Storage & Servers</title>
  6. <style type="text/css">
  7. body { font-family: arial;
  8.   font-size:9pt; line-height:1.3}
  9. @media all{
  10.   h1 { font-size:16pt }    
  11.   ul { 
  12.     margin:.5em 2em 1.4em 0; 
  13.     padding:0 
  14.     }
  15. ul li    { 
  16.     margin:0 0 .4em 1.5em;
  17.     list-style-type:point 
  18.     }
  19. }
  20. #imageDiv { position:absolute;left:430px;top:370px;z-index:0 }
  21.  
  22. #ContDiv { position:absolute;left:205px;top:100px;z-index:0 }
  23.  
  24. </style>
  25. <script language="JavaScript">
  26.  
  27. var width = screen.width;
  28. var height = screen.height;
  29. var origWidth, origHeight;
  30. if (document.layers) {
  31.     origWidth = window.innerWidth; origHeight = window.innerHeight;
  32.     window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
  33. }
  34.  
  35. var page_loaded; 
  36. function initCont() {
  37.   page_loaded = true; 
  38.   writeImage('imageDiv','ContDiv', origMsg, origImg, ttleMsg); 
  39. }
  40.  
  41.  
  42.  
  43. function writeCont(id, sHTML, s1HTML) {
  44.  
  45.   var lay = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
  46.   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>';
  47.   if (typeof lay.innerHTML!="undefined") {
  48.       lay.innerHTML = cntct;
  49.   } else if (document.layers) {
  50.             lay.document.write(cntct);
  51.             lay.document.close();
  52.   }
  53.  
  54.  
  55.  
  56. function writeImage(id,cntid,sHTML,img,s1HTML) {
  57.  
  58. //if(navigator.appName == "Microsoft Internet Explorer" || navigator.appName == "Netscape")
  59. //{
  60. //    if((navigator.appVersion.indexOf("MSIE") !=-1) || (Number(navigator.appVersion.charAt(0)) >= 4))
  61. //    {
  62. //        var indx = navigator.appVersion.indexOf("MSIE");
  63. //        var ver = Number(navigator.appVersion.substr((indx+5),3));
  64. //        if(ver >= 6 || (Number(navigator.appVersion.charAt(0)) >= 4))
  65. //        {
  66.  
  67.   if (!page_loaded) return;
  68.  
  69.   var lay = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
  70.   if (!lay) return;
  71.  
  72.   var imagecnt = '<IMG SRC="'+ img + '" NAME="sub1" WIDTH="100" HEIGHT="100" BORDER="0">';
  73.   if (typeof lay.innerHTML!="undefined") {
  74.       lay.innerHTML = imagecnt;
  75.   } else if (document.layers) {
  76.             lay.document.write(imagecnt);
  77.             lay.document.close();
  78.   }
  79.  
  80. writeCont(cntid, sHTML,s1HTML)
  81. //        } 
  82. //    }
  83. //}
  84.  
  85. }
  86.     function getParameter (queryString, parameterName) 
  87.     {
  88.         var tempStr = new String(queryString);
  89.         var parameterName = parameterName + "=";
  90.         if ( tempStr.length > 0 ) 
  91.         {
  92.             var begin = tempStr.indexOf (parameterName);
  93.  
  94.             if ( begin != -1 ) 
  95.             {
  96.                 begin += parameterName.length;
  97.                 end = tempStr.indexOf ( "&" , begin );
  98.                 if ( end == -1 ) { end = tempStr.length }
  99.                 return unescape ( tempStr.substring ( begin, end ) );
  100.             }
  101.             return "null";
  102.         }
  103.     }
  104.  
  105.     function go(cat) 
  106.     {
  107.         var catid = new String(cat);
  108.  
  109.         var qString = window.location;
  110.         var csName = getParameter(qString,'cs')
  111.         var sysName = getParameter(qString,'ModelSelection');
  112.         sysName = sysName +"&category_id="+catid;
  113.         var writeString;
  114.         //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";
  115.         //writeString = "http://accessories.us.dell.com/sna/DellItemsProductListing.aspx?c=us&l=en&fe=category_id&ModelSelection=166493&cs=19&ManufactSelection=" + sysName;
  116.         writeString = "http://accessories.us.dell.com/sna/DellItemsProductListing.aspx?c=us&l=en&cs="+ csName + "&ModelSelection=" + sysName;
  117.         //writeString = "http://accessories.us.dell.com/sna/productlisting.aspx?c=us&cs=19&l=en&s=dhs&k=" + sysName;
  118.         window.location = writeString;
  119.     }
  120.  
  121.  
  122.  
  123. // Variables for Layers
  124. 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>';
  125. var origImg = 'http://img.dell.com/images/global/shared/storage_hdd_watermark.jpg';
  126. var ttleMsg = 'Why Buy Dell Storage Devices?';
  127.  
  128. 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>';
  129. var dfltimg = 'http://img.dell.com/images/global/shared/storage_hdd_watermark.jpg';
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137. 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>';
  138. var img8 = 'http://img.dell.com/images/global/shared/storage_ext_dvdrw.jpg';
  139. var ttleMsg8 = 'What is an External DVD-RW?';
  140.  
  141.  
  142. </script>
  143.  
  144. </head>
  145. <body onload="initCont()">
  146.  
  147. <br><br/>
  148. <font size="2">
  149. <div>List of storage types:</div>
  150. <br><b>Disk Drives</b><br/>
  151. <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/>
  152. <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/>
  153.  
  154. <b>Compact Disk (CD) </b><br/>
  155. <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/>
  156. <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/>
  157. <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/>
  158.  
  159. <br/><b>Digital Video Disc (DVD)</b><br/>
  160.  
  161. <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/>
  162. <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/>
  163. <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/>
  164. <br/><b>External Storage</b><br/>
  165. <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/>
  166. <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/>
  167.  
  168.  
  169. <br/><br/><br/>
  170. </font>
  171. <div id="imageDiv">
  172. </div>
  173. <div id="ContDiv">
  174. </div>
  175.  
  176.  
  177. </body>
  178. </html>
  179.  
  180. ]]>
  181.  
  182.  
Sep 20 '06 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
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".
May 17 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.