X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   What is the point of.......? (https://forum.x-cart.com/showthread.php?t=3577)

parmar 07-12-2003 07:49 AM

What is the point of.......?
 
What is the point of script below within the /rectangle_bottom.tpl

Code:

<SCRIPT>
if (navigator.appName.indexOf('Microsoft')>=0)
document.write("<TR><TD height='100%'><img src={$ImagesDir}/spacer.gif width=1 height=1></TD></TR>" );
else
document.write("<TR><TD><img src={$ImagesDir}/spacer.gif width=1 height=1></TD></TR>" );
</SCRIPT>   


groovico 07-12-2003 02:29 PM

Re: What is the point of.......?
 
Quote:

Originally Posted by parmar
What is the point of script below within the /rectangle_bottom.tpl

Code:

<SCRIPT>
if (navigator.appName.indexOf('Microsoft')>=0)
document.write("<TR><TD height='100%'><img src={$ImagesDir}/spacer.gif width=1 height=1></TD></TR>" );
else
document.write("<TR><TD><img src={$ImagesDir}/spacer.gif width=1 height=1></TD></TR>" );
</SCRIPT>   



I was wondering the exact same thing, it looks like redundant code left in there. I deleted it, it does nothing other than get in the way of your layout.

webjoseph 07-13-2003 10:36 PM

actually its not redundant
 
This code was probably written to be cross-browser compatible. Netscape 4.0 doesn't recognize the TD tag setting where height=100%. It might just be for cosmetic looks where the cell expands all the way to the bottom to match the sides (in case your side panels extend really long), and the reason it's set to show when you have Explorer is because Explorer obeys this attribute.

The reason for the spacer.gif in both is because you want that there (or a non-breaking space if the height is needed to be greater than 1 px) so that the cell doesn't collapse. With Netscape browsers (and just for good coding practices), you should never have an empty cell.

groovico 07-16-2003 04:30 AM

Good thing netscape 4 is virtually extinct these day :) I've not had a netscrape 4 hit on my sites in ages. Even netscrape 6-7 only makes up 4% of hits on a site with 1.5 million visitors per year.


All times are GMT -8. The time now is 12:32 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.