javascript 中 with的用法:(简化语句)
2012-01-04 16:31
387 查看
with(document.getElementById(“userFrom”)) {
method = “post”;
action = “user_add.jsp”;
submit();
}
相当于:
document.getElementById(“userForm”).method = “post”;
document.getElementById(“userForm”).action = “user_add.jsp”;
document.getElementById(“userForm”).submit();
method = “post”;
action = “user_add.jsp”;
submit();
}
相当于:
document.getElementById(“userForm”).method = “post”;
document.getElementById(“userForm”).action = “user_add.jsp”;
document.getElementById(“userForm”).submit();
相关文章推荐
- Javascript中With语句用法实例
- Javascript中With语句用法实例
- Python with语句用法
- Javascript的with语句
- python中with语句的用法
- Javascript的for-in语句和with语句
- javascript with语句
- javascript中的 类初始化,遍历for in 以及with的用法
- Oracle with语句的用法
- JavaScript中的this、with的用法
- javascript 循环语句 while、do-while、for-in、for用法区别
- javascript中的with语句
- asp.net Parameters.AddWithValue方法在SQL语句的 Where 字句中的用法
- javascript简单事件处理和with用法介绍
- JavaScript中用let语句声明作用域的用法讲解
- JavaScript学习小结之被嫌弃的eval函数和with语句实例详解
- with 语句的用法
- javascript中的with语句