Ewebeditor Editor button is invalid, IE8 Ewebeditor Editor is unable to use the problem-solving method has two, one is the following method by modifying the JS file, in fact, we can also use the second method by adding this sentence to the page.
Copy Code code as follows:
<meta http-equiv= "x-ua-compatible" content= "ie=7"/>
Or
Copy Code code as follows:
<meta http-equiv= "x-ua-compatible" content= "Ie=emulateie7"/>
The above two meanings are the same, the wording is slightly different.
By modifying the JS file the following operations:
Find the Editor.js file in the Ewebeditor directory, where the path is webedit\include\editor.js (different paths are not necessarily the same as the new version webedit/js/editor.js), where the following code is found:
Copy Code code as follows:
if (element. Yuseronclick) {
Eval (element. Yuseronclick + "anonymous ()");
}
Or
Copy Code code as follows:
if (element. Yuseronclick) eval (element. Yuseronclick + "anonymous ()");
Different versions may differ in wording
Replace the above code with the
Copy Code code as follows:
if (Navigator.appVersion.match (/8./i) = = ' 8. ')
{
if (element. Yuseronclick) eval (element. Yuseronclick + "onclick (event)");
}
Else
{
if (element. Yuseronclick) eval (element. Yuseronclick + "anonymous ()");
}
You are under the background test, is the Ewebeditor Editor button can be used normally.
With such a piece of code, the browser version of a judge is good, IE6 below should also be able to use.
Summary:
If with IE upgrade we have to constantly increase the judgment, it is not more Khan. So it's good to make an editor of your own, after all, we use the Ewebeditor is free official will not provide free service.
Cloud Habitat Community Enhanced Edition:
It is strange that some friends installed IE8, the local pop-up navigator.appversion is IE8, but through the edit pop-up view is not IE8. As shown in the following figure
So we're adding fault tolerance, because there's usually only two cases, so we use fault-tolerant try catch to solve the problem, compatibility is better than above. Look at the code specifically
Copy Code code as follows:
if (element. Yuseronclick) {
try {
Eval (element. Yuseronclick + "anonymous ()");
}
catch (Err) {
Eval (element. Yuseronclick + "onclick (event)");
}
}