Introduction
Just like the Ajax framework mentioned in the previous section, simply put, jQuery is an excellent javascript framework, which allows users to conveniently handle html, events (bubble) events, animation effects, ajax interactions, etc. It greatly changes the developers' habits of using javascript. Since its initial creation in 2006, jQuery has attracted many javascript experts to join its team. As the incident progresses, new versions of jQuery have been released one by one, and it has attracted more and more attention.
Today, jQuery has developed into a powerful framework that integrates various javascript/css/dom and ajax functions. You can simply use code to achieve various web effects
Currently jQuery mainly provides the following functions:
1. Access the local part of the page framework, which is one of the main functions of the DOM model. DOM has a fixed method to obtain a certain node or a certain type of node on the page, and jQuery greatly simplifies its operation steps.
2. Modify the performance of the page. The main function of css is to modify the performance of the page through styles. jquery also solves the support level of css3 by many browsers, making each browser well use the css3 standard, greatly enriching the use of css.
3. Modify the content of the page. Through a powerful API, JQuery can easily modify page content, including text content, insert new images, form options, and even the entire page frame.
4. Respond to events. jquery can handle events conveniently, and developers no longer need to hate browser compatibility issues.
5.Add animation to the page。 Adding animations with javascript requires a lot of code, and jquery greatly simplifies this process and provides a lot of animation effects that can customize parameters.
6. Interact with the server. jquery provides a complete set of Ajax-related operations, which greatly facilitates the development and use of asynchronous interactions.
7. Simplify commonly used javascript operations. jquery provides many additional functions to simplify commonly used javascript operations, such as array operations, iterative operations, etc.
Advantages.
Use table interlaced color to illustrate the advantages of jquery
Interlaced color change with jquery
<script type="text/javascript">
= function() {
var oTable = ("mytable");
for (var i = 0;i < ; i++) {
if (i % 2 == 0)
[i].className = "altcss";
}
}
</script>
Using jquery to implement
<script type="text/javascript">
$(function(){
$("table#mytable tr:nth-child(odd)").addClass("altcss");
})
</script>
Table area code
<table width="800" cellspacing="0" border="1" >
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
The above is all the content of this article, which are very basic things. Experts, please skip it directly.