探索前端46-jQuery的奥秘

发表时间: 2023-02-04 21:40

前端46-jQuery.mp3" content="来自LearningYard学苑">

话说前端46-jQuery.mp31:44
来自LearningYard学苑

分享兴趣,传播快乐,增长见闻,留下美好!

亲爱的您,这里是LearningYard新学苑。

今天小编为大家带来话说前端46-jQuery,欢迎您的访问。

Share interests, spread happiness, increase knowledge, and leave a good legacy!

Dear you, this is The LearningYard Academy.

Today Xiaobian brings you The knowledge set 46| the lingo model of the maximum coverage model, welcome to your visit.

JQuery 概述:jQuery是一个快速、简洁的JavaScript库,在这个库中,封装了很多预先定义好的函数在里面,比如动画animate、hide、show,比如获取元素等。jQuery版本分两种类型:压缩版本: 省略写法,不利于阅读,体积小。项目上线使用未压缩版本:完整写法,利于阅读,体积大。学习和开发阶段使用。Query下载:官网:https://jquery.com/点击Download,找到对应的版本链接,点击,右击另存为。

Overview of JQuery: jQuery is a fast and concise JavaScript library. In this library, many predefined functions are encapsulated, such as animate, hide and show, such as getting elements. There are two types of jQuery version: compressed version: omitted writing, which is not conducive to reading and small in size. The uncompressed version used in the project online: complete writing, easy to read and large in size. Used in learning and development stages. Query Download: official website: https://jquery.com/ Click Download to find the corresponding version link, click, and right-click Save As.

JQuery 选择器:

JQuery selector:

总结: 就是和 css 的 选择器基本是一样的,但是要加引号

Summary: It is basically the same as the selector of css, but with quotation marks.

JQuery 入口函数:为了防止文档在完全加载(就绪)之前运行jquery代码,即在DOM加载完成之后才可以对 DOM 进行操作 使用ready函数.推荐使用 简写方式。

JQuery entry function: In order to prevent the document from running jquery code before it is fully loaded (ready), that is, the ready function can only be used after the DOM is loaded. Shorthand is recommended.

onload 和 ready:onload被成为javaScript的入口函数,reday被成为jQuery的入口函数

onload和ready的区别:window.onload 事件是等到所有内容,包括外部图片之类的文件加载完后,才会执行。ready 是在 html 所有标签(DOM)都加载之后,就会去执行。window.onload 事件只能执行一次,再写就会覆盖。ready 是可以执行多次,并且不会被覆盖。

Onload and ready:onload are the entry functions of javaScript, and reday is the entry function of jQuery.

The difference between onload and ready: the window.onload event will not be executed until all contents, including files such as external pictures, are loaded. Ready is executed after all html tags (DOM) are loaded. The window.onload event can only be executed once, and then it will be overwritten. Ready can be executed multiple times and will not be overwritten.

JQuery 选择器:

JQuery selector:

今天的分享就到这里了。如果您对今天的文章有什么独特的想法,欢迎评论留言,让我们相约明天,祝您今天过得开心快乐!

That's it for today's sharing. If you have any unique ideas for today's article, please leave a comment, let us meet tomorrow, I wish you a happy day!


翻译:google翻译

本文由LearningYard新学苑原创,部分图片文字来自网络,如有侵权请联系。

文字&排版|李仕阳

审核|李焕