this with
来源:互联网 发布:电脑加速软件 编辑:程序博客网 时间:2024/05/16 05:33
with 语句 为一个或一组语句指定默认对象。
用法:with (<对象>) <语句>;
with 语句通常用来缩短特定情形下必须写的代码量。在下面的例子中,请注意 Math 的重复使用:
x = Math.cos(3 * Math.PI) + Math.sin(Math.LN10);
y = Math.tan(14 * Math.E);
当使用 with 语句时,代码变得更短且更易读:
with (Math) {
x = cos(3 * PI) + sin(LN10);
y = tan(14 * E);
}
this 对象 返回“当前”对象。在不同的地方,this 代表不同的对象。如果在 JavaScript 的“主程序”中(不在任何 function 中,不在任何事件处理程序中)使用 this,它就代表 window 对象;如果在 with 语句块中使用 this,它就代表 with 所指定的对象;如果在事件处理程序中使用 this,它就代表发生事件的对象。
- this with
- JavaScript中with/this用法
- 使用with提前获取this
- 09-with-终极this应用
- this is incompatible with DISTINCT
- JavaScript中的this、with的用法
- this is a test post with Writer
- js中with和this的用法
- MSN - Not compatiable with this version
- JavaScript中的this、with的用法
- js中with、this的用法
- This system is not registered with RHN
- JavaScript中with、this用法小结
- This system is not registered with RHN
- This system is not registered with RHN
- This system is not registered with RHN
- This system is not registered with RHN
- This system is not registered with RHN
- 程序员怎么写情书
- extjs load data from mysql with php example
- Oracle中HWM浅谈
- Android.mk文件详解介绍
- ant编译带library的工程
- this with
- 递归实现之无限分类
- 史上最烂的代码
- JFreechart生成带热点的饼图
- 动态规划-各种整数划分
- 互联网系统架构的演进[转]
- nginx负载均衡实践
- git使用详细介绍
- 关于android示例程序(bitmapfun)——高效加载图片的坑爹地方