Magento: Cleaning up my themes, removing blank.html - html

I'm justing sorting and optimizing my Magento 1.5.1.0 theme and I'm asking myself, for what purpose this code snippet is and whether I can safely remove it.
Talking about this one:
<!--[if lt IE 7]>
<script type="text/javascript">
//<![CDATA[
var BLANK_URL = '<?php echo $this->helper('core/js')->getJsUrl('blank.html') ?>';
var BLANK_IMG = '<?php echo $this->helper('core/js')->getJsUrl('spacer.gif') ?>';
//]]>
</script>
<![endif]-->
Any advice is appreciated.
Thanks!

BLANK_URL is part of a IE6 fix, to make the browser show iframe backgrounds transparently, when being hovered.
BLANK_IMG is part of another IE6 fix, to make the browser show PNG images correctly, when used as background images.
Whether you can remove them, solely depends on which browsers you want to support.
If you want to remove them, be aware though, that you also should remove the proper .js includes, iehover-fix.js for BLANK_URL and/or ds-sleight.js for BLANK_IMG, too.
<!--[if lt IE 7]>
<script type="text/javascript" src="http://example.com/js/lib/ds-sleight.js"></script>
<script type="text/javascript" src="http://example.com/js/varien/iehover-fix.js"></script>
<![endif]-->

Related

IE Redirect Method

Use Different HTML for IE
I have developed a CSS Grid Site that works with all browsers except IE and have tried Autoprefixer which made improvements but did not fix all problems, some of which may not be Grid related. I am looking for recommendations to redirect ALL IE browsers to a completely different HTML file and would appreciate recommendations to do so. I already have separate HTML and CSS files that work with IE. Thanks for any suggestions.
I found this on another post and it seems to work well:
<<!-- For IE <= 9 -->
<!--[if IE]>
<script type="text/javascript">
window.location = "https://google.com";
</script>
<![endif]-->
<!-- For IE > 9 -->
<script type="text/javascript">
if (window.navigator.msPointerEnabled) {
window.location = "http://bobabend.com/index-old-as-of-3-7-2019.html";
}
</script>

I can use footer tag from HTML5 in IE8

I found something strange in my website... I'm using HTML5 and this script to use in olders browsers.
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
When I use <article>,<section> it works but when I use <footer> it doesn't.
I don't know the reason.
The others tags have the open tag and close tag.... This is the html code
Header:
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script>
<script type="text/javascript">
activaMapa = 0;
</script>
<![endif]-->
Footer Code
<footer class="pie">
<p>Web Site</p>
</footer>
Thanks for all the responses!
I found the problem...I'm looking my settings in IE and I've the scripting disabled... I activated and works!
Thanks for all!
Please change html5shim to html5shiv
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
Hope this may work
Older browsers doesn't support HTML5 tags. For this, you can use libraries like Modernizr or html5shim.
These libraries will provide support for older browsers bearing the HTML5 tags.
A good way to see if a tag is supported or not is by using CanIUse.com, and in this case, no, <footer> is not supported in ie8.
Instead, try using
<div id="footer"></div>
and for your css instead of
footer {
...
}
use
#footer {
...
}

Any browser other than IE8 and below

I want some html to be displayed for any browser other than IE8 and below
I tried this but it didn;t work. What's the correct syntax?
<!--[if !lte IE 8]>
// my html here
<![endif]-->
Just use greater than:
<!--[if gt IE 8]>
According to the conditional comment this is IE greater than 8<br />
<![endif]-->
Based on Mary Melodys comment you can also target everything apart from IE too! :
<!--[if !IE]><!-->
<link rel="stylesheet" type="text/css" href="not-ie.css" />
<!--<![endif]-->
To cover all bases, I thought I should give an answer about a third-party library like jQuery. This library adds a layer of java-script functionality to your website and comes with a range of functions for determining which browser is being used (as well as the version of that browser).
Here is the documentation to coding what you would like to achieve within jQuery: http://api.jquery.com/jquery.browser/
And here is a quick example of how this would work:
if($.browser.chrome) {
alert( $.browser.version );
} else if ($.browser.mozilla) {
alert( $.browser.version );
} else if ($.browser.msie) {
if ($.browser.version < 8){
//Do what you will.
}
}
Obviously if you are looking for a more lightweight / portable method then #iswinky's method is the way to go. However, if you are looking for a more heavy solution that supports a range of browsers then I would recommend this approach.

Excluding IE 6/7 traffic

I would like to ask if there is any easy way of displaying different page for IE6/7 users who enter a website.
Like a redirect from example.com to example.com/ie7
Unfortunately IE7 doesn't like the website I made so I want to display miniversion of the original website, I have put too much effort into the original to downgrade it now.
Will this line always work? On every version/build of IE7? Or is it more complicated?
I want to be sure that 100% of IE7 traffic gets redirected.
<!--[if IE]><meta http-equiv="refresh" content="0;URL=http://www.example.com/ie7"><![endif]-->
You can use a different CSS on the same page to get a simpler result
<!--[if lt IE 8]>
<link href="/IE7style.css" rel="stylesheet" type="text/css" media="all" />
<![endif]-->
Just overwrite all the styling needed to make IE7 happy
to serve content to IE7 , you need to set the version in conditionnal comments.
<!--[if IE 7 ]><p>I'm IE 7</p><![endif]-->
IE7 and lower :
<!--[if lte IE 7 ]><p>I'm IE 7 at the most.</p><![endif]-->
Where lte means Lighter Than or Equal
The better way is
<!--[if IE 7]>
<script type="text/javascript">
window.location = "http://www.example.com/ie7";
</script>
<![endif]-->
This should be done server side. You can use something like ua-parser to detect ie <=7, and redirect to a new site accordingly.

IE6 screwing the pooch here... what the hey!

http://sensenich.bythepixel.com/support/faq
If you look at the link in IE6 styling appears only when you scroll down. Then when you scroll back up it disappears. How is this possible?
Thanks
I don't have IE6 anymore but judging by the source I'd say jQuery is responsible. You might be better off not trying to be so fancy in IE6 and just focus on giving them the information. It's a dying browser anyway.
<!--[if lte IE 6]>
<script type="text/javascript" src="/assets/js/supersleight-min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#logo, #midfooter').supersleight();
});
</script>
<![endif]-->
This. Do you REALLY need it? On second thoughts, maybe you do need it, but try removing it to see if it's the culprit. If it is there are other scripts that solve the transparency problem you might have more luck with.