Magento Forum

[Bug] JS error in IE6, with transparent png logo
 
Inline Media
Sr. Member
 
Avatar
Total Posts:  130
Joined:  2007-09-17
The Netherlands
 

I’m creating a new design for my store and I am using a transparant PNG logo in my header.
All browsers show the image transparant except IE6, but I already knew this is a common problem in IE6.
I discovered that Magento already had a transparancy hack for IE, the file ds-sleight.js, but this wasn’t working because of a javascript error in IE6.

The JS error is: BLANK_IMG not defined.

I discovered this is a bug in the page layouts. I searched magento where BLANK_IMG was defined and found it in the template/page.phtml. I copied this code (see below) into the header of 3columns.phtml and the js error was gone and my PNG was showing transparent.

The following is placed in page.phtml.

<script type="text/javascript">
        var 
BLANK_URL '<?=$this->getJsUrl()?>blank.html';
        var 
BLANK_IMG '<?=$this->getJsUrl()?>spacer.gif';
        var 
BASE_URL '<?=$this->getUrl('*')?>';
        var 
SKIN_URL '<?=$this->getSkinUrl()?>';
    
</script>

My question is, should I copy this code in all the page layouts? Or should I define BLANK_IMG in the ds-sleight.js?
Or is there another workaround?

 
Magento Community Magento Community
Magento Community
Magento Community
 
SeL_
Magento Team
 
Avatar
Total Posts:  1140
Joined:  2007-10-10
Paris, France
 

Hi,

This bug is still existing in ver 0.8.16100.

I think the best solution is to add the following lines

<script type="text/javascript">
        var 
BLANK_URL '<?=$this->getJsUrl()?>blank.html';
        var 
BLANK_IMG '<?=$this->getJsUrl()?>spacer.gif';
        var 
BASE_URL '<?=$this->getUrl('*')?>';
        var 
SKIN_URL '<?=$this->getSkinUrl()?>';
    
</script>
in app/design/frontend/default/default/template/page/html/head.phtml

There is already

<script type="text/javascript">
        var 
BLANK_URL '<?=$this->getJsUrl()?>blank.html';
    
</script>
around line 11.
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top