Jump to content

is it possible to disable a module for IE ?


Recommended Posts

Hi there,

 

i have great issue that my new module's java script files makes my sites dirty on IE (see attached)

 

so i have to disable the module or script file on IE9.

 

is it possible to disable the module or only those scripts for IE ?

 

 

thanx in adv :)

post-487502-0-30655100-1377610455_thumb.jpg

Link to comment
Share on other sites

  • 4 weeks later...

I think i have the answer vekia.

 

You have to add this to your module PHP file.
 

<?php 
//echo $_SERVER['HTTP_USER_AGENT'];

 if(preg_match('/(?i)msie [1-8]/',$_SERVER['HTTP_USER_AGENT']))
{
    // if INTERNET EXPLORER IS VERSION 1 - 8
   ***** ENTER ALL OF YOUR MODULE.PHP FOR IE VERSIONS 1-8 *****
} 

else
{
    // if ANY OTHER BROWSER
   ***** ENTER ALL OF YOUR MODULE.PHP FOR ANY OTHER BROWSER HERE *****
}
 ?>

You would need 2 versions of the module.php, 1 for IE 1-8 and 1 for any other browser.

 

With this method you can call different CSS and TPL files :)

Edited by evolution.x (see edit history)
  • Like 1
Link to comment
Share on other sites

hi,

 

 i don't be sure how much its possible passing user agent on module expressions (i didn

t tried it in php). hope should work coz no idea than UA to find IE. :)

 

my bit of issue was only module's scripts conflicts on IE 7 , 8 and  IE 10 . i fixed it by stop the script execution 

 

i did it in jquery, usual code to target specific version 

if (!$.support.leadingWhitespace) {

// your stuff for IE 7 or 8

}elseif(/*@cc_on!@*/false){ 

// your stuff for IE10

}elseif ($.browser.msie  && parseInt($.browser.version, 9) > 8) {
  // your stuff  for IE 9
} 
Edited by mani313 (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...