Home  >  Article  >  Web Front-end  >  How to use JQuery and detailed explanation

How to use JQuery and detailed explanation

黄舟
黄舟Original
2017-02-27 14:51:382067browse

question? How to use JQuery and detailed explanation

1. Definition:

JQuery is another excellent ## after prototype #JavascriptLibrary (to put it bluntly, it is still based on JavaScript). It is lightweight js library, which is compatible with CSS3 and various browsers (IE 6.0+, FF 1.5+, Safari 2.0+, Opera 9.0+), jQuery2.0 and subsequent versions will no longer support IE6/7/8 browsers. jQuery enables users to more easily process HTML (an application under Standard Universal Markup Language), events, implement animation effects, and easily provide AJAX interaction for websites. Another big advantage of jQuery is that its documentation is very complete and its various applications are explained in detail. There are also many mature plug-ins to choose from. jQuery can keep the code and HTML content of the user's HTML page separated. In other words, there is no need to insert a bunch of js in the HTML to call the command. You only need to define the id.

jQuery is a javascript library compatible with multiple browsers. The core concept is write less, do more (write less, do more) get more). jQuery was released by American John Resig at barcamp in New York in January 2006, attracting many JavaScript experts from all over the world to join, led by Dave Methvin leads the team in development. Today, jQuery has become the most popular JavaScript library, used by more than 55% of the world's top 10,000 most visited websites.


2. Effect: I have summarized it myself, jquery can operate html related better than js. Label. There is no need to define various triggers in HTML elements like in js. All it takes is an id.


3. Use:

#(1) Go to the official website to download jquery Version, click download link 1, click download link 2. Here I am using the jquery-1.11.3.min version.


##(2)Import the package in html, asp, jsp and other web files

<script src="js/jquery-1.11.3.min.js" type="text/javascript" charset="utf-8"></script>

(3) Example: jquery


	<script>
		$(document).ready(C);
	    function C(){
			$("#a6").html("页面加载我赢了!");
		}
	</script>


Previous js writing method: In fact, the effect is the same, but jquery can make us look more concise.

function myFunction()
{
var obj=document.getElementById("h01");
obj.innerHTML="Hello jQuery";
}
The above is the usage method and detailed explanation of JQuery. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Statement:
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