摘要:
JS中的Break和Continue 这是两个特殊的字段,用在循环之中, 例子: 用Break statement来跳出循环 Explanation: The loop will break when i=3. 他的执行结果在下面呢 The number is 0The number is 1The number is 2 Explanation: The loop wil... 阅读全文
posted @ 2007-01-21 23:31
lxsohu
阅读(169)
评论(0)
推荐(0)
摘要:
在脚本JS中,你可以创建三种弹出对话框,限于我的编辑器,请大家自己,复制脚本去练习,Alert box, Confirm box, and Prompt box. 一 二 三 四 弹出对话框alert,当需要用户明确一种事件要执行,用户确定之后才能继续进行下去, 语法: alert("sometext") 弹出对话框Confirm Box,他用于用户确认... 阅读全文
posted @ 2007-01-21 23:11
lxsohu
阅读(245)
评论(0)
推荐(0)
摘要:
JS的LOOP(循环)是当条件满足一定数值的时候,来执行同一代码块特定的次数, 例子: FOR LOOP 用它来执行特定次数的同一代码 Explanation: This for loop starts with i=0. As long as i is less than, or equal to 5, the loop will continue to run. i will ... 阅读全文
posted @ 2007-01-21 23:10
lxsohu
阅读(220)
评论(0)
推荐(0)
摘要:
JS的函数 函数是一个可以重用的代码快,当一个事件出发或者函数本上被调用的时候。 怎么来调用一个函数呢? By pressing the button, a function will be called. The function will alert a message. 给一个函数传参数,并在函数中应用他,在下面有两个例子, ... 阅读全文
posted @ 2007-01-21 23:09
lxsohu
阅读(180)
评论(0)
推荐(0)
摘要:
JS操作符,! 逻辑操作符号 && and x=6y=3 (x 1) returns true || or x=6y=3 ... 阅读全文
posted @ 2007-01-21 11:51
lxsohu
阅读(231)
评论(0)
推荐(0)
摘要:
SWIYCH语句,是条件语句中的一种,具体写法给出一个例子, 用法:如果你必须在多个块中选择执行一个特定块,那么SWITCH语句是最好的, 1 2 3 2122This JavaScript will generate a different greeting based on what day it is. Note that Sunday=0, Monday=1, Tuesday=2, ... 阅读全文
posted @ 2007-01-21 11:28
lxsohu
阅读(211)
评论(0)
推荐(0)
摘要:
JS IF.....ELSE语句 条件语句在JS中用于在不同的条件下执行特定的语句块的语句, 下面的例子分别演示如何写一个IF语句,IF...ELSE语句,IF..ELSE IF...ELSE 语句,还有一个随机链接的例子,代码如下 一 This example demonstrates the If statement. If the time on your b... 阅读全文
posted @ 2007-01-21 11:23
lxsohu
阅读(244)
评论(0)
推荐(0)
摘要:
JS变量, 变量是一个你要存储信息的容器。 例子: This example declares a variable, assigns a value to it, and then displays the variable. Then the variable is displayed one more time, only this time as a heading. ... 阅读全文
posted @ 2007-01-21 11:06
lxsohu
阅读(187)
评论(0)
推荐(0)
浙公网安备 33010602011771号