Javascript-jquery Ajax () a few newline characters, solving-segmentfault

Source: Internet
Author: User
Keywords Php javascript jquery firebug html
Tags button type

Using $.ajax () Back-end PHP to get the string, there is only loginsuccess or loginfaild to return a few characters, using alert () and Console.log () to see there is nothing wrong, but with Firebug debugging see, The return value character is appended with a few rnrn characters, which causes the JS judgment to fail.

To search the Internet, but also someone encountered a similar situation, I tried the jquery1.8 and 1.3 of the library, will be more out of these newline characters, do not know this is a jquery bug, or what reason?

Http://www.cnblogs.com/js-html/p/3384940.html

Reply content:

Using $.ajax () Back-end PHP to get the string, there is only loginsuccess or loginfaild to return a few characters, using alert () and Console.log () to see there is nothing wrong, but with Firebug debugging see, The return value character is appended with a few rnrn characters, which causes the JS judgment to fail.

To search the Internet, but also someone encountered a similar situation, I tried the jquery1.8 and 1.3 of the library, will be more out of these newline characters, do not know this is a jquery bug, or what reason?

Http://www.cnblogs.com/js-html/p/3384940.html

    • Asked 2 hours ago
    • Comments
    • Invitation to answer

Please login and comment first

Sort By default sorting time

1 answers

The answer is helpful to the person, has the reference value 0 The answer is no help, it's the wrong answer, irrelevantly replying .

Check for extra white space characters outside of PHP tags

Http://stackoverflow.com/questions/11593326/unwanted-new-line-returned-after-ajax-request

  • 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.