JQuery (connotation: jquery selector)
JQuery writes common js methods to a Framework library.
This is the official jQuery website. You have time to take a look.
Jquery.com
1. Download jquery
Ii. Loading jquery files
Refresh the page.
Well, learning about jquery can achieve the idea of understanding its programming and achieve the goal of using jquery to develop common web page effects.
The ultimate goal is: "sharp jQuery" (HD scan version-bookmarks)
JQuery online API: http://api.jquery.com
What is a JavaScript Framework library?
Disadvantages of common JavaScript: different controls are operated in different ways, and different browsers are different. It is very troublesome to write cross-browser programs. As a result, many JavaScript encapsulation libraries have emerged.
Common JavaScript Framework library
Prototype ['pr shortut protocol. taip], YUI, Dojo ['dod shorto, bean porridge], ExtJS, jQuery, etc. These libraries encapsulate JavaScript and simplify development. These libraries encapsulate JavaScript and are implemented using JavaScript internally. (Lenovo SQLHelper)
3. Create an ASP Website
Iv. content loaded by ASP websites for us
JQuery:
JQuery is a function class written in JavaScript syntax. It still calls JavaScript internally, so it does not replace JavaScript. JavaScript technology is still required to use jQuery code and compile jQuery extension plug-ins. jQuery itself is a bunch of JavaScript Functions.
JQuery is the most popular JavaScript library and has been integrated into VS2010. It is supported by MS. The combination of MS Ajax toolkit and jQuery is also the most convenient, and there are many jQuery extension plug-ins.
What are the characteristics of jQuery? Write Less, Do More
Compatible with different browsers (IE 6.0 +, FF 2 +, Safari 3.0 +, Opera 9.0 +, Chrome)
Question: when there is a problem, consider whether it is css compatibility.
Different controls have a uniform operation method.
Small size (dozens of KB), easy to use (Write Less Do More)
Chained programming $ ("# div1"). draggble (). show (). hide (). fly (), implicit Iteration
Rich plug-ins, open-source, and free.
It makes JavaScript programming simpler and more powerful!
Is there a lot of functionality? There are many searches on the Internet. There are many plug-ins for individual users.
If the version is vs2008, there is no smart prompt, you need to install sp1 pudding.
VisualStudio 2008SP1:
Http://www.microsoft.com/downloads/details.aspx? Displaylang = zh-cn & familyid = 27673c47-b3b5-4c67-bd99-84e525b5ce61
Again Ann Yi VS90SP1-KB958502-x86:
Http://code.msdn.microsoft.com/KB958502/Release/ProjectReleases.aspx? ReleaseId = 1736
Step 3
Jquery-1.4.1-vsdoc.js [vs2008, smart prompt files needed]
So we recommend that you use vs2010
The following describes the top-level objects in jQuery $
V. Introduction
6. Another method of writing top-level objects
Next, we will refer to the following section:
7. Tips
I am not worried about writing jQuery code first. Let's take a look at this problem first.
8. Two minor issues
9. $ (document) Introduction
10. Prepare the ready event for jq
11. Differences between window. onload and $ (document). ready ()
12. Recommended writing
How to Write window. onload with jq?
13. Call window. load in jq
Let's take a look at $. map and $. each in jquery.
14. $. map in jquery
15. Functions of the map Method
Let's see how the map method returns this function internally?
16th and F12: How does map implement it internally?
17. Check jq source code
When we want to write something in js but don't write it, we can see how the jq method is implemented. This is a good self-learning method.
18. Unwritten array Length
Next, let's look at two examples.
19th and two map examples
20. Previous traversal methods
21. debug each
22. each traverses key-value pairs
Next, let's take a look at how to use each to traverse a common array:
33. Use each to traverse a common Array
Let's think about this. Why do we use return false to jump out of the loop? We recommend that you set a breakpoint for debugging.
34. debug and understand why return false
Next let's take a look: trim () in jQuery ()
35, $. trim
. Internal call of Regular Expressions
Next let's take a look at the conversion between jquery objects and Dom objects.
37. convert a dom object to a jquery object
Convert a dom object to a jquery object
Next, let's look at the new requirements.
. Two Ways to convert a jquery object to a dom object
Let's talk about some methods in jquery:
The. text () method is equivalent to innerText or textContent.
. Val ("ddd") does not have a parameter to indicate obtaining, and a parameter to indicate setting a value.
. Html ("")/html () is equivalent to innerHTML
To put it simply, Let's explain which one we will use later.
Does an Array object have a corresponding jQuery object?
The array itself is not a Dom object. There is no conversion with the jQuery object. Using jQuery statements, you can directly use arrays, like $. each () or $. map ();
Supplement: Use document. getElementsByTagName () or document. the returned value obtained by getElementsByName () is an array-like value, but not an array. It does not have an array-specific method, such as reverse, similar to the string in C #, it can be regarded as a char array, but it is not. string is an encapsulation of the char array.
ParseInt () \ Array does not need to be converted.
The following describes the jquery selector:
Introduction to thirty-nine and three selector types
Demonstration of three selectors
Next we will look at two cases:
Case 1: Set the content displayed in a div by using the Id Selector
Case 2: register a click event for a button. When you click it, set the text displayed in all p labels on the page to "Chuan is a dog ". // Implicit Iteration
Code for two exercise questions
Demonstration of two exercise questions
. Set css styles
, Chain Programming
The passed value mainly depends on how js judges.
The following describes the labels and class selectors.
Forty-three, tag plus class selector
Demonstration of tag-adding class selector
Next we will talk about the multi-condition selector:
Forty-four, multi-condition Selector
Next let's talk about the level selector:
There are four types:
Forty-five: four types of code
Note: there must be no more space in the selector expression. Easy to error! Pay attention to filter and form selector.
Next (); // The first sibling element (next) next to the current element)
NextAll (); // All sibling elements after the current element
Prev (); // The sibling element adjacent to the current element (previous one)
PrevAll (); // All sibling elements before the current element
Siblings (); // All sibling elements of the current element
Next we will look at two cases:
46. Case 1
Case 1 Demonstration
47. Case 2-scoring control code
Case 2-scoring control demonstration
Next, determine whether the elements on the next page exist.
Forty-eight: first case of error
Forty-nine, the second case of errors
50. packaging set
Next, let's talk about how to use jq to operate class style css.
. Use jq to operate class style css
Next we will make a function to turn off the light.
, "Turn off the light" code
Switch lamp and use jq to operate class style css demonstration
List of recent articles by the author:
C # basic tutorial (free of charge, the best gift for code lovers. Note: The authors share their carefully organized basic C # tutorials without any commercial purposes. I hope to share my experiences with more code lovers. Please give me more advice !!!) |
Layer 3 |
Layer 3 (1) |
Layer-3 cases (and Common Errors) |
Layer-3 instances (SQL CRUD) |
SQL database ADO.net |
Database Application diagram 1 |
Database Application details 2 |
ADO. NET (connotation efficiency problem) |
Process-oriented, object-oriented, and advanced |
Process-oriented, object-oriented in-depth understanding 1 |
Process-oriented, object-oriented in-depth understanding 2 |
Object-oriented deep understanding 3 |
Winform Basics |
Winform Basics |
Commonly used controls in winform |
Process-oriented |
Comparison of three cycles |
Method (I) in C) |
Our common Array |
Object-oriented |
Thought Change |
C # super-class and easy-to-use classes |
The use of destructor and namespaces in C # |
C # super-class and easy-to-use strings |
How to quickly process strings in C # |
Value Type, reference type, and others |
ArrayList and HashTable |
ArrayList and HashTable |
File Management |
Polymorphism |
Section on other issues in C # |
GDI + |
The GDI + code I have collected over the years |
The GDI + Code 2 I collected over the years |
HTML overview and CSS |
HTML language that you cannot ignore |
You can't ignore HTML 2. |
HTML language 3 that you cannot ignore |
CSS basic content-special contribution to the Mid-Autumn Festival |
CSS basic content 2 |
JavaScript Basics |
JavaScript basics 1 |