Use of JavaScript relay semantics

Source: Internet
Author: User

In the recent property project, there is a home page information display function, to achieve this function is not very complex, of course, first of all think of using asynchronous to achieve.

When the request returns data processing, the return result that pops up on the page is inconsistent with the output in the console, the result of the pop-up on the page is that the four digits of the real result are processed 0. The reason for this is because the argument was not passed as a string at the time of the pass, that is, show (' 123456789876543212 '), so JavaScript automatically treats the following as the number type by 0.

This involves the use of the JavaScript relay, which first introduces several escape characters:

\ '-single quotes, \ '-double quotes, \&-and numbers, \/backslash, \ n-line feed, \ r-Carriage return, \ t-tab, \b-backspace, \f-page break;

As for the specific how to achieve, look at the picture as an example



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.