简体   繁体   中英

internet explorer 8 quirks mode remote vs local

Hi I had a problem that i couldn't understand with internet explorer 8. I have a javascript code containing a trailing comma, i know it have to be deleted, but I want to understand something about it. So, here's a part of the reason of the problem, I'm in Quirks mode

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

My problem is, when I open the page in local mode, there is no problem, and the page is displayed correctly. However, when i access it from the remote server, there is errors in the page. Is there a difference in treating Quirks mode when a page is accessed locally or remotely?

the IE using the Quirks Mode per default, when accessing fron the Intranet. You can force it into Standardmode by using this META-Tag:

<meta http-equiv=\"X-UA-Compatible\" content=\"IE=8\" />

IE8 has a config flag buried deep in its settings that allows you to specify that sites on the local intranet are rendered using the IE7-compatibility engine.

It's a very good chance that this is what you're seeing. It's not likely to be actual quirks-mode, more likely to be just the bugs and missing features in the IE7 rendering engine.

To find out if this is what has happened, open the Developer Tools window (press F12) and look in the toolbar -- it will tell you the Browser Mode: if it says 'IE7' or 'Compatibility View' then you need to change it to IE8, and go find the settings flag and change that.

This same toolbar will also tell you whether you're actually in quirks mode or not, so you can confirm that too at the same time.

If you do need to change the compatibility view on the browser settings, then the bad news is that you may find yourself having to do that on all the machines in your network (or having someone else do it for you!). Fortunately, there is a fix which you can put on your web page to force the browser mode without having to set the flag. Add the following line to your site, and it should solve the problem:

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

Hope that helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM