The ewebeditor editor button is invalid. In IE8, The ewebeditor cannot use two solutions. One is to modify the JS file by using the following methods, in fact, we can also use the second method by adding this sentence to the page.
CopyCode The Code is as follows: <meta http-equiv = "X-UA-compatible" content = "Ie = 7"/>
OrCopy codeThe Code is as follows: <meta http-equiv = "X-UA-compatible" content = "Ie = emulateie7"/>
The two meanings above are the same, and the writing method is slightly different.
Modify the JS file as follows:
Find the editor in the ewebeditor directory. JS file, path: webedit \ include \ editor. JS (webedit/JS/editor in different versions may not be the same in different paths. JS), find the following code:Copy codeThe Code is as follows: if (element. yuseronclick ){
Eval (element. yuseronclick + "anonymous ()");
}
OrCopy codeThe Code is as follows: if (element. yuseronclick) eval (element. yuseronclick + "anonymous ()");
Different versions may be written differently.
Replace the above CodeCopy codeThe Code is 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 ()");
}
Check whether the ewebeditor button works properly in the background.
With such a piece of code, you can make a judgment on the browser version. IE6 should also be used.
Summary:
If we need to keep making judgments with the upgrade of IE, isn't it even more sweaty. Therefore, it is cost-effective to make an editor by yourself. After all, the ewebeditor we use is free and official services will not be provided free of charge.
enhanced version:
it is strange that some friends have installed IE8 and the navigator is displayed locally. the appversion is IE8, but it is not ie8. as shown in figure
by editing the pop-up figure, we add fault tolerance, because only these two situations usually occur, so we can solve this problem with a fault tolerance try catch. The compatibility is better than the above. For more information, see the Code copy the Code . The Code is as follows: if (element. yuseronclick) {
try {
eval (element. yuseronclick + "anonymous ()");
}< br> catch (ERR) {
eval (element. yuseronclick + "onclick (event)");
}< BR >}