Jquery beginner's guide. Q0 is required for beginners:
Step 1: jQuery Chinese Getting Started Guide, translation plus example, jQuery's starting point tutorial
Step 2: Download the manual for easy query (jQuery 1.41 Chinese API documentation chm Version)
Step 3: understand the differences between jQuery objects and common DOM objects. Mutual conversion: Q1
Q1, js Writing Method: document. getElementById ('save'). disabled = true;
In jquery, I wrote $ ("# save"). disabled = true. Why is it ineffective?
A. This is A typical problem. In fact, $ ("# save") is actually A jQuery object, not A common DOM object.
This is a common problem for beginners.
Solution:
1. Use JQ to write $ ("# save"). attr ("disabled", "true ");
2. convert it to DOM writing $ ("# save") [0]. disabled = true;
Of course, $ ("# save") [0] can also be written as $ ("# save"). get (0 ). It also returns DOM elements.
$ ("# Save"). eq (0) returns the jq object.
$ (Dom object) to get a jq object.
Q2: Obtain the selected checkbox.
A:
Retrieve all selected checkboxes:
$ ("Input: checkbox: checked ")
Check whether a group of checkpoints are selected:
If ($ ("input: checkbox: checked"). length ){}
Checks whether a checkbox is selected.
If ($ ("input: checkbox"). is (": checked ")){}
Q3: My id contains [] or... What should I do? Or the xml tag with a namespace carries: What should I do?
A: escape with \ As shown in
$ ("# Id \ [1 \]")
Q4: how to operate the objects in the parent window on the Framework page
A. Reference UPC Method
No good method found
We had to use the DOM method and jquery method to achieve this.
1. In the parent window, select all radio buttons in IFRAME.
$ (Window. frames ["iframe1" cmd.doc ument). find ("input [type = 'Radio ']"). attr ("checked", "true ");
2. in IFRAME, select all radio buttons in the parent window
Vertex (w.w.parent.doc ument). find ("input [type = 'Radio ']"). attr ("checked", "true ");
Iframe framework:
Test in IE7. Go back and try it by yourself.
The principle of implementation is that $ (DOM object) can be converted to a jquery object.
========================================================== ============
However, my method is
Window. parent. jQuery ("input [name = validate]"). val ("<% = Session (" GetCode ") %> ");
The verification code is automatically entered from my blog. If you are interested, you can analyze the framework in my FOOTER.
In essence, it is the same as the UPC method. For your reference
Q5: Parse XML loaded by AJAX and related garbled issues
A: see the previous post: hhttp: // bbs.jquery.org.cn/read.php? Tid-1673.html
Q6: I have implemented a plug-in Interface. How can this problem be solved in the latest jQuery?
A: The Interface has been completely rewritten and renamed jQuery UI. You can find the latest version here:
Http://ui.jquery.com/
Q7: the animation will flash in IE, and the effect is not ideal.
A. Add the DTD definition.
For example
Q8: Why does the official saying
Download jQuery 1.2.3 (
15kb, Minified and Gzipped), but I have
Jquery-1.2.3.min.js
52.8 KB
A, apparently, he uses Gzip (A server-side compression technology, GOOGLE by himself ). It's not something wrong on the official website ~
Q9, pack, min, and the original version are different?
Pack is used when the server does not enable gzip
Min is used when the server has opened gzip
The original version can be used for development or source code analysis.
Q10. What compression software does jQuery use?
A: The Packer written by Dean Edwards has been compressed with TBCompressor (YUI Compressor. We recommend that you download one copy.
Q11, $ ('a [@ href ^ = "mailto"] ') This Code cannot be used in jQuery 1.3. It can be used in 1.2. Why?
A: jQuery 1.3 and later do not need to use the @ symbol any more. simply remove the @ symbol to work properly.
Q12, does jQuery support cross-origin?
A: jQuery is an encapsulation of JS. the browser has permission settings for JS, and JavaScript cannot. jQuery cannot. However, you can use the jsonp Method for cross-origin.