3

I need to show a different webpage when i open my website in IE6 and below version.

Need to show fbrowser.html file when my website opens in IE6 and below versions.

Please suggest!!

2

3 Answers 3

4

In head:

<!--[if lte IE 6]>
<meta http-equiv="refresh" content="0; url=fbrowser.html">
<![endif]-->

Sorry, no javascript needed.

8
  • that's interesting - what is doing the parsing and interpretation there?
    – nwaltham
    Jan 25, 2012 at 12:01
  • 1
    If i m right it should be <!--[if lte IE 6]>, see missing > in end
    – Sudesh
    Jan 25, 2012 at 12:29
  • 1
    @user859955 these are conditional comments, which are used only by IE. Doing it like this hides the content from other browsers.
    – Mr Lister
    Jan 25, 2012 at 12:47
  • Yup it is working now. but i need to do it for all my html pages. pasting this code is in all the pages is the only solution fopr this? or is there any way to redirect to the fbrowser.html when the domain name opens? And also it should not only for ie 6, it is for ie6 and lower ie versions
    – Sowmya
    Jan 27, 2012 at 7:51
  • This syntax uses lte which means "less than or equal" so it detects all IE versions 6 and below. Problem solved! But if you want to detect IE earlier than during the page load, you might be better off detecting the browser on the server side. What platform are you using?
    – Mr Lister
    Jan 27, 2012 at 8:18
1

You could consider using http://api.jquery.com/jQuery.browser/

0

According to this answer, you can try somethiing like the following:

<script type="text/javascript">
    // <![CDATA[
    var BrowserCheck = Class.create({
        initialize: function () {
            var userAgent = navigator.userAgent.toLowerCase();
            this.version = (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1];
            this.safari = /webkit/.test(userAgent) && !/chrome/.test(userAgent);
            this.opera = /opera/.test(userAgent);
            this.msie = /msie/.test(userAgent) && !/opera/.test(userAgent);
            this.mozilla = /mozilla/.test(userAgent) && !/(compatible|webkit)/.test(userAgent);
            this.chrome = /chrome/.test(userAgent);
        }
    });    
    // ]]>
</script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.