js this 和Jquery $(this)平常注意
来源:互联网 发布:c 查询网络北京时间 编辑:程序博客网 时间:2024/06/05 10:04
1.在写jquery的时候,别用$(this),而是要在一个地方用着$(this),就var $this = $(this),防止在循环或者别的地方混淆
2.js的this可以指定到js对象或者document对象,而$(this)只是一个jquery对象,不是js对象本身也不是document对象
eg:TEST = {
id:"",
init:function(){
this.id ="1";//这样可以改变TEST对象的id
$(this).id = "1";//这样不行
}
}
0 0
- js this 和Jquery $(this)平常注意
- jquery&js $(this) & this
- jquery:this和$(this)
- 【Web前端】Js 中的 this 和 jQuery 中的 this
- Jquery中的$(this)和JS中的this的差别
- JQuery中的this和$(this)
- jquery中的this和$(this)
- jquery中的this和$(this)
- JQuery this 和 $(this) 详解
- jquery-插件-$(this)和this
- JS 中 和 JQuery 的 this 关键字
- js this和$(this)区别
- JQuery中用this时注意:
- jquery中this与$(this)的用法区别.和于js中的this区别
- jquery中this与$(this)的用法区别.和于js中的this区别
- jquery中this与$(this)的用法区别.和于js中的this区别
- jquery中this与$(this)的用法区别.和于js中的this区别
- jquery中this与$(this)的用法区别.和于js中的this区别
- Irrlicht 3D Engine 笔记系列 之 自定义Animator
- linux下php源码安装(apache服务器篇)
- 最大字段和问题
- 调用百度地图API去掉地图左下角的百度LOGO方法
- USB启动模式类型分析
- js this 和Jquery $(this)平常注意
- Compare Version Numbers,Fraction to Recurring Decimal
- android 清空屏幕以及ProterDuffXfermode.Mode.clear
- hdu 2101
- MySQL触发器基本操作
- C10K问题
- freescale LTIB
- linux下php源码安装(nginx服务器篇)
- hdu 2105