How does Ajax retrieve data from the ewebeditor text editor in JavaScript?

Source: Internet
Author: User

After changing the courseware to Ajax over the past few days, students can submit data automatically as soon as they do so that I can learn about their completion in a timely manner, so that they do not have to wait until they submit the courseware in a unified manner, I found an automatically submitted Ajax file on the Internet.Program, It took some time to study thoroughly and correct it. One of the problems I encountered was that I used the ewebeditor of ASP. To obtain the data in time, I finally found it:
Alert({{frames('ewebeditor1'{.}}frames('ewebeditor'{.doc ument. getelementsbytagname ('body') [0]. innerhtml );
Complicated!

Supplement: The above sentence can be used in the button, but it cannot be used in Ajax. js will report "Incorrect RunTime". After one day, I finally found out that, it should have been found. The original 'webeditor' comes with function processing:

< Script Language = Javascript >
// Retrieve the editor content
VaR Shtml = Ewebeditor1.gethtml ();
// Set Editor content
Ewebeditor1.sethtml (' < B > Hello my world ! </ B > ');
// Insert in the current selection
Ewebeditor1.inserthtml ('this is insert Function ! ');
// Append content at the end
Ewebeditor1.appendhtml ('this is append Function ! ');
// Change Editor status to code editing status
Ewebeditor1.setmode ('code ');
</ Script >  

The gethtml function is valid in the button. It is invalid if it is used directly on the page (I debug it on the page), for example, the above one. It is effective in Ajax.
So I finally completed all the automatic submission procedures for the courseware!

PS: I booked a ticket yesterday and flew to Tianjin on the 1st. According to the headmaster, I don't want to turn over if I couldn't get my score. I don't want to participate in the November quality class review held in Zhuhai, Guangdong Province, well, you must succeed!

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.