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 \, for example, <Div id = "id [1]"> </div>
$ ("# 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: <IFRAME src = "test.html" id = "iframe1" width = "700" Height = "300" frameborder = "0" scrolling = "Auto"> </iframe>
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: http://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, <! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Q8: Why does the official saying
Download jquery 1.2.3 (15kb, Minified and gzipped), but I have
Jquery-1.2.3.min.js52.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: Packer written by Dean EdwardsHttp://dean.edwards.name/packer/
Q11, $ ('a [@ href ^ = "mailto "] ')CodeIt cannot be used in jquery 1.3, or 1.2. Why?
A: jquery 1.3 and later do not need to use the @ symbol any more. Just remove the @ symbol to work properly..
Original article address:Http://bbs.jquery.org.cn/read.php? Tid-1873.html