imitating jquery, a cache system is designed. Similar to jquery. Data, prototype and mootools are also used to assist the Event System and cache the generated data, rather than caching the results of the previous calculation of common functions.
The following
Code It is a reference for anyone learning jquery.
HTML code:
CodeCopy codeThe Code is as follows:
Javascript:
Copy codeThe Code is as follows: $ (document). Ready (function (){VaR $ warp = $ ("# warp ");$ Warp. isrunning =
Copy codeThe Code is as follows: $ ("dd"). bind ("click", function (e ){
Var $ obj = require (e.tar get );
Var I = 0;
For (var x in $ obj ){
I ++;
Var $ hr = (I % 5 = 0 )? " ":"";
Document. write (x + "" + $ hr );
}
});
Traversal result:0 length
How does jquery set the onclick event of the button input? For example, there is a button at the beginning: This line of code is generated in the background of the program, and Discuz! In the same way as in the source code of the NT Forum, all
$ ("Form "). attr ("check"); $ ("form "). prop ("check"); both of them are acceptable, but the new version of jquery recommends the second one. Both of them are similar in other aspects. The only difference I found is that in checkbox, you need to
In order to exercise JQuery, I decided to write pages by myself
Final Effect
After clicking a letter, all words with the letter as the first letter are displayed below;
Display by page. 15 words are displayed on each page. Each group has 20 pages,
In jQuery, how does one manipulate valueless attributes such as hidden and disable?
Some hidden attributes will be placed on some form submission pages. The following describes how to manipulate the valueless attributes such as hidden and disable
JQuery Select drop-down box operation summary (recommended), jquery drop-down box
JQuery gets the Select element and selects the Text and Value:
1. $ ("# select_id"). change (function () {// code...}); // Add an event for Select, triggered when one
Attr (name)Obtains the attribute value of the First Matching Element. This method can be used to conveniently obtain the value of an attribute from the First Matching Element. If the element does not have a property, undefined is returned.Access a
In JS, set the attribute and attribute value of the node to setattribute (), get the attribute and attribute value of the node used to GetAttribute (), and in jquery, with a attr () can be all done, praise a first ^^jquery uses the attr () method to
Overview
jquery is another excellent JavaScript library following prototype. It is a lightweight JS library. It is compatible with CSS3 and is also compatible with various browsers (IE 6.0+, FF 1.5+, Safari 2.0+, Opera 9.0+). JQuery2.0 and
The code is as follows:DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd ">HTML>Head>Mce:style> -Mce:style>styleMce_bogus= "1">style>title>JS Get check box is selected valuetitle>Head>Body>inputtype= "
0. Common code: (1) Ajax request$ (function () {$ (' #send '). Click (function () {$.ajax ({type: "GET",//get or Post,async:true,//default is set to True, all requests are asynchronous requests.) URL: "http://www.idaima.com/xxxxx.php", Data:
Summary of Knowledge points 1, Properties Property (if your selector selects multiple objects, the default is to return only the first property), attr (Property name | property value) -one parameter is the value of the Get property, and two
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.