1. 首页
  2. 数据库
  3. 其它
  4. jQuery $.data()方法使用注意细节

jQuery $.data()方法使用注意细节

上传者: 2020-12-22 22:54:12上传 PDF文件 35.42KB 热度 15次
前段时间同事在群里对jQuery里的.data()方法大发牢骚: XXX(NNNNNNN) 15:11:34 alert($(‘#a’).data(‘xxx’));//123 data方法不靠谱 XXX(NNNNNNN) 15:13:17 老老实实用attr(‘data-xxx’)吧细研究了下jQuery文档对.data()方法的描述: 代码如下: As of jQuery 1.4.3 HTML 5 data- attributes will be automatically pulled in to jQuery’s data o
下载地址
用户评论