1. add jquery's js2. to add an action to the element (for demonstration, it is directly written in html): [javascript] & lt; td & gt; customer name: & lt; inputtype & amp; #39; text & amp; #39; id & amp; #39; name & amp; #39; onblur & amp; #39; burFunc () & amp; #39; na
1. Add jquery js
2. Add an action for the element (for demonstration, it is directly written in html ):
[Javascript]
Customer name:
3. Add a processing function:
[Javascript]
Function burFunc (){
$. Get ('url', {// use the get Method for ajax operations
Name: $ ("# name"). val () // parameters passed to the backend
}, Function (data, textStatus) {// data is the data returned by the backend.
... // Some operations
}, "Json"); // indicates that the data returned by the backend is in json format.
}
4. Run, OK!
In addition, we will briefly introduce the differences between innerhtml () and innertext:
Test. innerHTML:
It also contains all content from the starting position to the ending position of the object, including Html tags.
For example, "test1 ".
Test. innerText:
Content from the starting position to the ending position, but it removes the Html Tag
For example, "test1", where the span tag is removed.