Home>Article>Web Front-end> How does jquery determine whether it is an IE browser?
The method for jquery to determine whether it is an IE browser: first create a new HTML file; then create a click button to determine the browser type; finally pass "if (window.ActiveXObject || "ActiveXObject" in window" Method to judge.
The operating environment of this tutorial: windows7 system, jquery1.10.0 version, this method is suitable for all brands of computers.
Recommended : "jquery video tutorial"
This method is suitable for all brands of computers.
jquery determines whether it is an ie browser method
Create a new html file, and then create a click button to determine the browser type. As shown in the figure:
Code:
Judge whether the browser is IE browser. Use if (window.ActiveXObject || "ActiveXObject" in window) This line of code determines the type of browser. If it is an IE browser, it returns true, otherwise it returns false. In the case, an alert pop-up box will pop up to show whether it is an IE browser. As shown in the figure:
Code:
After saving the html file, open it with IE browser. Click the browser button to find the content of the alert pop-up box. For: ie, when using other browsers to open the click button, the background prompt box displays: not ie.
The above is the detailed content of How does jquery determine whether it is an IE browser?. For more information, please follow other related articles on the PHP Chinese website!