[JavaScript] encoding &i string formatting &nput history & Empty Modal Box

Source: Internet
Author: User
Tags add time

Coding problem in JS

Https://www.haorooms.com/post/js_escape_encodeURIComponent

I in the front-end JS Add time to create the DOM, there are Chinese characters, found to be garbled on the study of the next

For character encoding

 javascript:escape("\u6625\u8282");//输出 "%u6625%u8282" javascript:unescape("%u6625%u8282");//输出 "春节" javascript:unescape("\u6625\u8282");//输出 "春节"

For URL Chinese character coding

encodeURIComponent()相比encodeURI()要更加彻底。decodeURI()
JS string formatting

When I created the DOM at the front-end JS Add, I found that I could not make the string concatenation, not the way to create the object.

50570406

var s="my name is %s, I'm %s years old, and I have %s brother."s=s.format("wendy",24,2)结果s为:"my name is wendy, I'm 24 years old, and I have 2 brother."
Prevent browsers from recording text boxes before they are entered

Https://baijunyao.com/index.php/article/17

<input class="text" autocomplete="off" type="text" name="word" value="输入商品名称">
Per modal box JQ empty

This is when added, the Popup modal box always has the last record.
https://www.formget.com/jquery-reset-form/

$(selector)[0].reset();

[JavaScript] encoding &i string formatting &nput history & Empty Modal Box

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.