Home > Web Front-end > JS Tutorial > Some notes on jQuery_jquery

Some notes on jQuery_jquery

WBOY
Release: 2016-05-16 19:23:37
Original
1100 people have browsed it

When using jQuery, I always thought that what I retrieved using $("#someid") was an extension of the DOM object, so I felt comfortable using $("#someid").value,$("#someid"). text and the like, but unfortunately I have never been able to get the desired value. It was later discovered that it was not an extension. If you want to get a value similar to the above, you need to use $("#someid").val(), $("#someid").text(). I only discovered these after checking its api documentation. I can’t help but sigh, how important JavaScripty’s api documentation is.
These two methods: $("#formId").submit(), $("#formId").submit(function(){ ...}), the difference between the two is that the former is called submit method, the latter is to add the onsubmit method.
Using jQuery to call ajax is very convenient, $.get, $.post, you will find out after reading these two methods. It is very convenient to use fp in javascript. If it is Java, it will only use anonymous class methods at present. The code is not concise, and there is no flavor of fp at all.
Use thickbox (go to http://jquery.com/plugins, find the homepage of thickbox, look at the example and you will be able to use it), you should pay attention when writing pop-up windows, if you use #td_inline, for example Write like this







Then write the button like this:



The problem now is that if you want to get the value (or other attributes) of nameTextfield in a pop-up window, you will not be able to get the value you want, because the pop-up window is actually another new one. div, the objects inside are different from the objects in messageDiv. If you want to use document.getElementById("nameTextfield") at this time, you must be careful, because the text box obtained is not in the pop-up window.
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