Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does IE restrict the JavaScript files of local HTML pages?

Tags:

Why does IE restrict JavaScript files from working when we open a local html file? The message says:

"To help protect your security, Internet explorer has restricted this web page from running scripts or ActiveX controls that could access your computer. Click here for the options"

Can anyone tell me how get get rid of this?

like image 835
subho das Avatar asked Nov 16 '11 04:11

subho das


People also ask

How do I open a local HTML file in Internet Explorer?

You can also press "Ctrl-O" in your browser to open a file selection window. Navigate to the HTML file you wish to open and double-click it to you that file in your browser. Internet Explorer becomes your default browser when you install Windows. It will launch when you double-click an HTML file.

Can JavaScript manipulate local files?

It can be concluded that although JavaScript cannot access local files directly due to privacy and security, the file can be selected through the “file input” element which can process the file. A “File Reader” can then be used to access the content of the selected files.


1 Answers

Check out http://msdn.microsoft.com/en-us/library/ms537628(v=vs.85).aspx

If you want to run in the Internet zone add this to your HTML source:

<!-- saved from url=(0014)about:internet --> 

If you want to run in the Intranet zone add this to your HTML source:

<!-- saved from url=(0016)http://localhost --> 

Either will stop the message from displaying and allow JavaScript to execute.

This will also allow the file to open on other PC's without having to change Internet Explorer options.

like image 199
Trent Scholl Avatar answered Sep 27 '22 21:09

Trent Scholl