0

In the website, the support in IE is from version 9 onwards. So when I open it behaves properly (as i have IE 8), showing an alert. Picture included

enter image description here

However I don't want the background image to be loaded (which is getting loaded in my case). Only a blank screen displaying the alert info. How to achieve that?

This is the script I have used

 if(browsername=="Internet Explorer")
  {
    if(browserver<9.0)
    {
        alert("Your browser version is "+bowser.version+" and the minimum required version for this website is 9.0.So please use IE 9+.");
        window.location.href="http://www.google.com";
        //alert(bowser.name+","+bowser.version);
    }
  }
Salman A
  • 262,204
  • 82
  • 430
  • 521
Nihar
  • 553
  • 1
  • 10
  • 29

3 Answers3

0

suppose your background is body background then put:

$("body").css("background","");

before the alert() code.

Volkan Ulukut
  • 4,230
  • 1
  • 20
  • 38
0

This may not be the most optimal/appropriate way to handle the case. But in my case I just used the

$('#divid').hide();

before the alert statement

Now its working fine.

Rahul Kumar
  • 528
  • 1
  • 3
  • 19
Nihar
  • 553
  • 1
  • 10
  • 29
0

I've think you must do lazy loading of your background image.

  1. Check the browser, to check you must use this How can you detect the version of a browser?
  2. If browser is higher or equal than IE9 use code:

    <body data-lazy-image="path-to-image"></body>

    var lazy = $("body").attr("data-lazy-image"); $("body").css("backgroundImage",lazy);

something like this.

Community
  • 1
  • 1
Farkhat Mikhalko
  • 3,565
  • 3
  • 23
  • 37