In IE7, IE8, and IE10, The eWebEditor button is invalid. What should I do?

Source: Internet
Author: User

Yesterday, I upgraded my computer browser to ie8. Then I encountered a problem. One of my web buttons using the eWebEditor was invalid, after repeated troubleshooting, I found an X point for the program that writes the eWebEditor editor. Next I will introduce the solution process.

After searching by multiple parties, it is found that a JS file in the editor has a problem. Because IE7 and IE8 do not support anonymous (), you need to replace it with an onclick (event) event, and a Js file in the editor uses anonymous ().

Solution:

Find the Editor. js file in the directory of eWebEditor. The path is webeditshortdeeditor. js open with notepad. Find the following code (line 1 ):

The Code is as follows: Copy code


If (element. YUSERONCLICK) eval (element. YUSERONCLICK + "anonymous ()");

Because the onclick (event) event is not supported in IE6, the corresponding event must be determined based on the browser version, so the code can be changed:

The Code is as follows: Copy code

If (navigator. appVersion. match (/8./I) = '8. ') // determines whether the browser is IE8. if yes, run the following code:
{
If (element. YUSERONCLICK) eval (element. YUSERONCLICK + "onclick (event )");
}
Else // if not, run the following code
{
If (element. YUSERONCLICK) eval (element. YUSERONCLICK + "anonymous ()");
}

Or

If (navigator. appVersion. match (/MSIE 7. /I) = 'msie 7. '& navigator. appVersion. match (/Trident/I) = 'think') | navigator. appVersion. match (/MSIE 8. /I) = 'msie 8. ')
{
If (element. YUSERONCLICK) eval (element. YUSERONCLICK + "onclick (event )");
}
Else
{
If (element. YUSERONCLICK) eval (element. YUSERONCLICK + "anonymous ()");
}

Related Article

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.