2015.4.22 regular match, anti-data conversion, redundant part ellipsis processing login

Source: Internet
Author: User

1. Analytic <a href=javascript:void(0)> notation

workaround : The difference between clear void 0 and undefined

2, seek regular, like [{"Key": "Value"},{"key": "Value"},{"key": "Value"}] to [["Value"],["value"],["value"] "How to do?"

Workaround : /[^"}{:]*?(?="})/g
Note : the regular tool

3, this paragraph after the end of the superfluous part with "..... "How do you do that?"

resolution : The js length of the character to judge, more than the interception of a certain length of the addition "...", or
cssAdd{text-overflow: ellipsis; white-space: nowrap}

4. In the If Else statement, the function declaration promotion is invalid, how to solve it? Code:
if (1===0) {} Else  = setTimeout (myfun,1000); function myfun () {Console.log (' a ')}}

workaround : Get the function out of the definition.
parsing : Do not assign a value to a variable after the IF, or define a function after the IF, it can be defined outside the IF, and if inside the call. For example, the function in this question refers to the

function myfun () {Console.log (' a ')}
5, take the data inside with character this front-end display how to let it not convert to &gt,&lt, but the correct display, such as <br/> this tag (using the template engine, all was converted)?

workaround : Handlers the template {{{}}}, two parentheses into three parentheses. This will not transform and become the original ecological.

2015.4.22 regular match, anti-data conversion, redundant part ellipsis processing login

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.