Home > Web Front-end > JS Tutorial > Collection of commonly used jQuery front-end skills_jquery

Collection of commonly used jQuery front-end skills_jquery

WBOY
Release: 2016-05-16 16:24:44
Original
1113 people have browsed it

Use console.log() skillfully when debugging, which is much more convenient than using alert().

Jquery error prone point: when splicing elements, the elements have not been added to the DOM, so use this pre-add element operation.

The data dynamically obtained by ajax has not yet been loaded with html elements. Next, we will start operating with pre-assembled elements.

Copy code The code is as follows:

Written like this, when you click "Submit", the error "Uncaught SyntaxError: Unexpected token )" will be reported. In fact, writing "javascript:void()" will also report this error, change it to "javascript:void(0)" That’s it

Copy code The code is as follows:

Finally change it to this.

Copy code The code is as follows:

"asdafjl".replace(new RegExp("a", "gm"), "w"); //There is no function to replace All in javascript, so you can only use this. Replace all a’s with w

I always thought that a string is an array of characters, so "abc"[0] equals "0". In fact, neither IE6 nor 7 supports this. The solution is

Copy code The code is as follows:

var data="abc".ToString().split('');
//data[0] is equal to "a"
checkbox centered


When the server control checkbox generates HTML, span will be added outside. Therefore, you cannot directly add styles to server controls.

Copy code The code is as follows:

input[type="checkbox"]
{
        vertical-align:middle;
}
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template