- 热门文章:
- · asp的cookie本身不设置的话默认的是application的path=/,所以不设关系不大,expires要设。给你netscape...
- · html的标准里这样写的。
- · Dreamweaver 4 & UltraDev 4两个BUG(字体设置不能保存和行号显示错位)的解决方法
- · 一个DHTML的例子——3D文字
- · 如何做页面自动刷新,又不用让用户按回车键来提交数据!(大功告成)
- · javascript对象与数组参考大全1
- · javascript对象与数组参考大全2
- · 一个点击后自动滚屏的例子!
- · 一个鼠标自动移动的js例子!
- · window.showModalDialog()中有三个参数,各有什么用,请举例!
- · 三级下拉框连动的数据库版!
- · 给一个类增加属性和方法?看看这个够不够?
上一篇:在javascript 里面有没有检查日期格式的函数? >>
js中with的和case的用法
Enables the execution of one or more statements when a specified expression@#s value matches a label.<br>
<br>
switch (expression) {<br>
case label :<br>
statementlist<br>
case label :<br>
statementlist<br>
...<br>
default :<br>
statementlist<br>
} <br>
<br>
Arguments<br>
expression<br>
<br>
The expression to be evaluated.<br>
<br>
label<br>
<br>
An identifier to be matched against expression. If label === expression, execution starts with the statementlist immediately after the colon, and continues until it encounters either a break statement, which is optional, or the end of the switch statement.<br>
<br>
statementlist<br>
<br>
One or more statements to be executed.<br>
<br>
Remarks<br>
Use the default clause to provide a statement to be executed if none of the label values matches expression. It can appear anywhere within the switch code block. <br>
<br>
Zero or more label blocks may be specified. If no label matches the value of expression, and a default case is not supplied, no statements are executed.<br>
<br>
Execution flows through a switch statement as follows: <br>
<br>
Evaluate expression and look at label in order until a match is found. <br>
If a label value equals expression, execute its accompanying statementlist. <br>
Continue execution until a break statement is encountered, or the switch statement ends. This means that multiple label blocks are executed if a break statement is not used. <br>
If no label equals expression, go to the default case. If there is no default case, go to last step. <br>
Continue execution at the statement following the end of the switch code block. <br>
Example<br>
The following example tests an object for its type. <br>
<br>
function MyObject() {<br>
...}<br>
<br>
switch (object.constructor){<br>
case Date:<br>
...<br>
case Number:<br>
...<br>
case String:<br>
...<br>
case MyObject:<br>
...<br>
default: <br>
...<br>
}<br>
Requirements<br>
Version 3<br>
<br>
with Statement<br>
Establishes the default object for a statement. <br>
<br>
with (object)<br>
statements <br>
<br>
Arguments<br>
object<br>
<br>
The new default object.<br>
<br>
statements<br>
<br>
One or more statements for which object is the default object.<br>
<br>
Remarks<br>
The with statement is commonly used to shorten the amount of code that you have to write in certain situations. In the example that follows, notice the repeated use of Math. <br>
<br>
x = Math.cos(3 * Math.PI) + Math.sin(Math.LN10) <br>
y = Math.tan(14 * Math.E)<br>
When you use the with statement, your code becomes shorter and easier to read: <br>
<br>
with (Math){<br>
x = cos(3 * PI) + sin (LN10) <br>
y = tan(14 * E)<br>
}<br>
Requirements<br>
Version 1
相关文章:
- · 在网页中实现OICQ里的头像选择的下拉框 (附例子)
- · 请看用javascript设置和读取cookie的简单例子.....
- · 请看被打开的子窗口继承父窗口定义的styleSheets的例子
- · 经常有人询问如何用javascript判断日期是否有效,我以前也遇到过,不过后来得高人指点解决了,贴出来大...
- · ShowModalDialog的具体用法
- · 下拉式互动列表框(EC潮流网同学录之真情留言板使用的代码)
- · MSGBOX返回值
- · js中几种去掉字串左右空格的方法,请看
- · VBSctipt 5.0中的新特性
- · Jscript 5.0中的新特性
- · 加快 DHTML 的一组技巧(Copy from Microsoft)
- · 一个不太让人讨厌的自动弹出窗口:)
- · 一个把数字转英文的实用程序
- · rollarea.js及其用法示例
- · 下拉框连动的小例子(.htm版)
- · 判断访问者的浏览器是否支持javascript和Cookies
- · 在Windows桌面上使用WSH接收邮件 (转)
- · HTML4.0的 Access Key
- · 绝对是好东西 (select1 <==> select2):
- · 一个类似vbscript的round函数的javascript函数
- · 用javascript检查yyyy-mm-dd格式的正确源码。
- · HEAD元素使用集锦 (转)
- · 脚本控制Frame (转)
- · vbscript错误代码及对应解释大全
- · jscript错误代码及相应解释大全
- · 打开最大化窗口的一点经验
- · 无偿贡献,进入页面后自动刷新一次
- · 庆祝 Joy ASP 上贴数超过800页!!! 送给大家一个小礼物 ^_^
- · 自己动手,结合javascript和dhtml做一个ubb编辑器(附例子代码)
- · 选择最快的镜像站点
- · 一段有趣并且实用的程序--利用javascript和dhtml实现两个列表框中内容的移动。(代码见内,把它存为一个...
- · 动态菜单的另一种实现(一) category.js
- · 动态数组的另一种实现(二) 界面
- · 实际使用“DXML”:在站点上实现 DHTML 菜单和目录(co.)
- · 以前收集的一些资料---JS中处理日期的一些函数和方法
- · 以前搜集的一些资料---html中的特殊字符(2)
- · 以前搜集的一些资料---html中的特殊字符(1)
- · 在浏览器里实现类似VB Form的界面控制
