Stop annoying warnings while testing in IE
Posted: Thu Jul 07, 2011 8:12 am
While I am sure some people know this, if you don't, it can be a source of annoyance while trying to test client-side Javascript code in IE (you are testing in all browsers, right?
). As you have probably seen first-hand, when you try to load a page from your local hard drive in IE that has Javascript in it you will get a warning ribbon telling you that to protect you, scripts and/or ActiveX content has been blocked, and you must click to enable it...every single time you test the page in IE.
The reason for this is because IE uses a different security setting for pages loaded from the file system. In theory, this is a good idea because it is technically possible to download spoofed or malicious websites to your hard drive and then feed you the URL to open them, causing tons of damage. In practice, however, this is a very rare attack. So rare that other browsers don't even care. In fact, IE even honors a line of code to get around the warning (see below).
If you want to get rid of this annoying warning while testing in IE, you can add the mark of the web. Simply add this strange line of code to your page under the DOCTYPE declarations and/or XML namespaces (for XHTML), and before the body tag:
This tells IE to treat the page as if it was downloaded from the internet. The number 14 is the number of characters in the URL. You can change it to the number of characters in your URL, but it seems to work for me no matter what the number is (not sure if it will be that way in all versions of IE).
The reason for this is because IE uses a different security setting for pages loaded from the file system. In theory, this is a good idea because it is technically possible to download spoofed or malicious websites to your hard drive and then feed you the URL to open them, causing tons of damage. In practice, however, this is a very rare attack. So rare that other browsers don't even care. In fact, IE even honors a line of code to get around the warning (see below).
If you want to get rid of this annoying warning while testing in IE, you can add the mark of the web. Simply add this strange line of code to your page under the DOCTYPE declarations and/or XML namespaces (for XHTML), and before the body tag:
Code: Select all
<!-- saved from url=(0014)about:internet -->