The Script Does Not Work In IE. How Can I Fix It?
There is a script that changes the page template depending on the user's monitor screen resolution. However, it does not work in IE. Advise how to fix it, please. <
Solution 1:
outerWidth
is supported by IE, but since from the IE9.
Solution 2:
Not all browsers have the window.outerWidth and window.outerHeight properties. Geek Daily has a good post on cross-browser window size detection. I'd suggest looking there. As an example, here's what I get in each browser on a desktop with 1280x1024 resolution.
Chrome
window.outerWidth
1288
document.body.offsetWidth
1264
document.documentElement.offsetWidth
1280
Firefox
window.outerWidth
1288
document.body.offsetWidth
1238
document.documentElement.offsetWidth
1264
IE7 Doctype Defined
window.outerWidth
undefined
document.body.offsetWidth
1260
document.documentElement.offsetWidth
1260
IE7 No Doctype/Quirks Mode
window.outerWidth
undefined
document.body.offsetWidth
1260
document.documentElement.offsetWidth
1280
Solution 3:
I see a few other problems
- All of your attribute values should be in quotes. for example.
id="value"
- you have LEFT spelled 1(number 1)eft
Post a Comment for "The Script Does Not Work In IE. How Can I Fix It?"