Getting started with jquery on the Web Front-end and getting started with jquery on the web Front-end
This chapter introduces the following content;
1. Main Features of jquery;
2. Create a jquery encoding environment;
3. Simple jquery script example;
4. Reasons for choosing jquery instead of javaScript alone;
5. Common jquery development tools;
What can jquery do?
① Obtain the elements in the document
$('div.content').find('p');
② Modify the appearance of the page
$('ul > li:first').addClass('active');
③ Change document content
$('#container').append('<a href="www.baidu,com">more</a>')
④ Add dynamic effects to the page
$('div.content').slideDown();
⑤ Respond to user interaction
$('button.show-details').click(function(){ $('div.details').show();});
⑥ You do not need to refresh the page to obtain information from the server
$('div.details').load('more.html #content');
7. Simplify common javaScript tasks
$.each(obj, function(key,value)(
total += value;
));
Why is jquery so outstanding?
1. Taking advantage of CSS;
2. Support expansion;
3. Inconsistent abstract browsers;
4. Always set-oriented;
5. perform multiple operations on one row;
How to download jquery?
1. JavaScript is an interpreted language, so you don't have to worry about compiling and building it. When to use jquery, you only need to use the <script> element in the HTML document to import it.
2, jquery Official Website: http://jquery.com/
Which development and testing tools are available?
Modern browsers generally have built-in high-quality development tools. We can choose tools that we find convenient. Some recommended tools are listed below:
1. IE;
2. Safari;
3. Chrome;
4. Firefox;
5. Opera;
The tools listed above provide similar functions:
1. Test and modify the DOM;
2. Study the relationship between CSS and page monetization;
3. Convenient tracking script execution through special methods;
4. Pause script execution and check variable values;