It took an early morning (more than four hours) to sum up the lesson: the text content in the textarea tag cannot be obtained through the serialize () method, textareaserialize

Source: Internet
Author: User

It took an early morning (more than four hours) to sum up the lesson: the text content in the textarea tag cannot be obtained through the serialize () method, textareaserialize
1. Let's take a look at the complete code, that is, the final answer! 2. The above results were obtained after several hours of torture, and it was not easy for programmers! However, there will be many detours during this period. See the following: 2.1 at the beginning: the textarea tag is in the form and serialized directly using serialize () in Jquery; 2.2, but the results were miserable. When I added a new news item, I clearly entered the news title and content. Why is the prompt blank? Is it absorbed by Web black holes? I don't believe it. I have a strong confidence to find the reason; **************************************** * ******** is a difficult period of thinking, when I urinated, I suddenly thought that the text in textarea may not be serialize () serialized, right? **************************************** * ****** 2.3 I continued to edit the news, "HAHAHA" is the content read from the database. After I add a new sentence, click Submit to view the debugging result in VS. According to the assumption, this new statement will not be passed to server 2.4OMG! I did not pass it over. Happy! Find the reason! If you find the cause, you will be able to find the problem. 3.0, We will test the code that has been completed! 3.1 How can I edit a news article? 3.2 after testing, it is no problem to add a new news article! 4.0 conclusion: 4.1 In fact, The textarea tag is correct in the form or in the form, but the performance is slightly better! If you think about it, it seems that there are more than one procedure; 4.2 is actually mainly to get the content of the text domain through JS code, then add "& nEditor =" + GetContent () after the serialized data to the server. Function GetContent () {return CKEDITOR. instances. nEditor. getData (); // here, nEditor is the name value of textarea}


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.