user2084575
user2084575

Reputation: 11

IE9 Quirks mode - Doctype statement commented out

I'm having an issue where IE9 is rendering a single page on my site in Quirks mode.

http://www.bettereverafter.com/index.php?fc=module&module=blockwishlistpro&controller=view&token=E5D343F0E9D5C666

For some reason, it is taking the DOCTYPE delcaration in my header file and commenting out. The Doctype I am using is:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

It seems to be pulling in some additional code, which I think is coming from here:

It looks like it is getting called here:

private function _displayProducts($id_wishlist)
{
    global $cookie;
    include_once(dirname(__FILE__).'/WishListpro.php');
    include_once(_PS_CLASS_DIR_.'/Message.php');
echo "  
<script type='text/javascript'> 
// <![CDATA[
ThickboxI18nImage = 'Image';
ThickboxI18nOf = '/';
ThickboxI18nClose = 'X';
ThickboxI18nOrEscKey = 'Esc';
ThickboxI18nNext = '>';
ThickboxI18nPrev = '<';
tb_pathToImage = '"._MODULE_DIR_.self::modulename."/img/loadingAnimation.gif';
//]]> 
</script>";

My issue is, that code is not actually in the header file, it's coming from somewhere else. I have no idea how it is getting loaded before the actual header file though...

I have already tried adding but that doesn't do anything.

Every other page seems to work fine, just this one. If I force it into IE9 Standards, it looks fine. Any ideas would be much appreciated!

Upvotes: 1

Views: 1524

Answers (1)

tw16
tw16

Reputation: 29625

The problem is caused by having this code before your doctype:

<script type='text/javascript'> 
// <![CDATA[
    ThickboxI18nImage = 'Image';
    ThickboxI18nOf = '/';
    ThickboxI18nClose = 'X';
    ThickboxI18nOrEscKey = 'Esc';
    ThickboxI18nNext = '>';
    ThickboxI18nPrev = '<';
    tb_pathToImage = '/modules/blockwishlistpro/img/loadingAnimation.gif';
//]]>
</script>

You cannot have anything (not even a comment) before your doctype or IE will render in quirks mode instead of standards mode.

Upvotes: 1

Related Questions