jQuery.data()和.data()之间的区别? [英] Differences between jQuery.data() and .data()?

查看:132
本文介绍了jQuery.data()和.data()之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我正在阅读 jquery 文档,但无法识别功能jQuery.data().data()之间的区别.这些功能之间的主要区别是什么?

So, i was reading the jquery documentation and i couldn't identify the differences between the functions jQuery.data() and .data(). What are the main difference between those functions?

以下是文档的链接: Doc jquery

推荐答案

对于前者而言,后者只是一种更方便的语法:$.(domElement, 'key')$('selector').data('key')做同样的事情.

The latter is just a more convenient syntax for the former: $.(domElement, 'key') and $('selector').data('key') do the same thing.

这篇关于jQuery.data()和.data()之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆