Home  >  Article  >  Web Front-end  >  How to correctly set the JavaScript options of IE browser

How to correctly set the JavaScript options of IE browser

PHPz
PHPzOriginal
2023-04-21 09:10:281752browse

As one of the oldest browsers, IE is still the best choice for many enterprise-level applications. When developing using IE, we often use JavaScript to enhance user interaction. However, IE's JavaScript default settings may affect the normal operation of web pages, so some settings are required. Now, let's introduce how to correctly set the JavaScript options of IE browser.

1. Open the Internet Options of the IE browser

Select "Tools" -> "Internet Options" in the top menu bar of the IE browser to open the Internet Options window.

2. Set the security level of IE browser

In the Internet Options window, switch to the "Security" tab. As you can see, IE browser divides web pages into 4 security areas, namely "Internet", "Local Intranet", "Trusted Sites" and "Restricted Sites". By default, the security levels of these four areas are medium, and JavaScript requires a lower security level to run and access.

So, we need to set the security level of the corresponding security zone to "medium-low" so that JavaScript scripts can run normally. The specific steps are as follows:

  1. Select the "Internet" area and click the "Custom Level" button.
  2. In the pop-up security settings window, find the "Script" option and set it to "Enable".
  3. Other security settings can be adjusted according to your own needs, and then click the "OK" button to save the settings.
  4. Next, follow the same steps to set the security levels of the three areas: "Local Intranet", "Trusted Sites" and "Restricted Sites".

3. Enable Active Scripting of IE browser

In addition, IE browser will also disable Active Scripting by default, which will cause many web page functions to not work properly. If you need to use JavaScript, you also need to enable Active Scripting in Internet Options. The steps are as follows:

  1. Switch to the "Security" tab, and then select the "Internet" zone.
  2. Click the "Custom Level" button, find the "Active Scripting" option in the pop-up security settings window, and set it to "Enable".
  3. Click the "OK" button to save the settings.
  4. Next, you must also enable Active Scripting for the three areas of "Local Intranet", "Trusted Sites" and "Restricted Sites".

4. Other precautions

In addition to the above settings, we also need to pay attention to the following points:

  1. If it is used in IE11 and above versions JavaScript, then you need to switch the IE browser to "Compatibility View" mode, otherwise JavaScript may not run properly.
  2. Make sure that the IE browser has been updated to the latest version, because the new version may fix some JavaScript-related issues that exist in the old version.
  3. If you are using IE7 and below, you need to enable both the "Java" and "ActiveX Controls and Plug-ins" options to ensure that all scripts and plug-ins in the web page can run normally.

Conclusion

This article introduces how to correctly set the JavaScript options of the IE browser. I hope it will be helpful to readers who use IE for development. Correctly setting browser options can not only ensure the normal operation of web pages, but also improve the security of web pages and avoid being attacked by hackers.

The above is the detailed content of How to correctly set the JavaScript options of IE browser. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn