Completely solve the Ewebeditor Web site can not upload the image of the method _ page Editor

Source: Internet
Author: User
Tags anonymous eval
After our technician check, the result is Ewebeditor text editor of the IE8 browser compatibility caused by scripting errors, is not what "web space, server poisoning, problems" it! Now the solution is published to everyone, to facilitate the revision of their own website code so that the text editor in a variety of browsers can be compatible, normal use!
workaround IE8 does not support the Ewebeditor online text editor as follows:
"1" first find the Editor.js file in the Include directory under the Ewebeditor text editor root (note: Different ewebeditor versions of the Editor.js files may be in the same directory, some may be in the JS directory)
"2" opens the Editor.js file in Notepad and finds the following code:

if (element. Yuseronclick) Eval_r (element. Yuseronclick + ' anonymous () ');

Note: Different versions of Ewebeditor may have a different code, or the following code:
Copy Code code as follows:

if (element. Yuseronclick) {
Eval_r (element. Yuseronclick + ' anonymous () ');
}

The above two pieces of code is only different writing format, the code, meaning is the same!
"3" replaces the above code with the following code:
Copy Code code as follows:

if (Navigator.appVersion.match (/8./i) = = ' 8. ')
{
if (element. Yuseronclick) Eval_r (element. Yuseronclick + ' onclick (event) ');
}
Else
{
if (element. Yuseronclick) Eval_r (element. Yuseronclick + ' anonymous () ');
}

"4" tested in IE6, IE7, IE8 under normal use, but in the machine equipped with IE8 on the use of proud browser is still not normal use, Khan! Then add one more thing to judge the browser code:
Copy Code code as follows:

if (Navigator.appVersion.match (/8./i) = = ' 8. | | Navigator.appVersion.match (/maxthon/i) = = ' MAXTHON ')
{
if (element. Yuseronclick) Eval_r (element. Yuseronclick + "onclick (event)");
}
Else
{
if (element. Yuseronclick) Eval_r (element. Yuseronclick + "anonymous ()");
}


After testing IE6, IE7, IE8, roaming, 360 browser can be normal use! In addition, if the above method is not good, you may wish to try the following construction methods:
Copy Code code as follows:

try{
if (element. Yuseronclick) Eval_r (element. Yuseronclick + "anonymous ()");
}
catch (e) {
if (element. Yuseronclick) Eval_r (element. Yuseronclick + "onclick (event)");
}

IE8 does not support end-level solutions for ewebeditor online text editors:
If you find the above code is not good! What's going on? That's because you're using an upgraded version of IE8, that use code read out of the IE version number is actually upgraded before the version number, that version good read is wrong, with the above code of course is not possible, at this time you'd better download and install a final release version of the IE8 on it, Or you have to use the code to change:
Copy Code code as follows:

if (Navigator.appVersion.match (/msie (7|8) \./i)!=null) {
if (element. Yuseronclick) eval (element. Yuseronclick + "onclick (event)");
}else{
if (element. Yuseronclick) eval (element. Yuseronclick + "anonymous ()");
}

Or
Copy Code code as follows:

try{
if (element. Yuseronclick) eval (element. Yuseronclick + "anonymous ()");
}
catch (e) {
if (element. Yuseronclick) eval (element. Yuseronclick + "onclick (event)");
}

But the above modification method will cause the text editor to be invalid under the normal IE7 browser!!! So it's best to (convince the client) to install a final version of IE8!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.