
JavaScript
文章平均质量分 84
lingle77
keep on learning
展开
-
{welcome to JS} 使用外部脚本
1.通过src属性调用js文件 welcome1.html My Second Script script02.js window.onload = writeMessage; function writeMessage(){ document.getElementById("helloMessage").innerHTML = "Hello,wor原创 2015-09-14 22:40:38 · 676 阅读 · 0 评论 -
{welcome to JS} 使用多级条件(switch&case)
welcome09.html 621# About these girls script09.js window.onload = initAll; function initAll(){ document.getElementById("ChenDan").onclick = say原创 2015-09-17 12:24:28 · 1949 阅读 · 0 评论 -
{welcome to JS} 提示用户
1.通过prompt()提示用户作出响应 welcom5.html Test prompt() You can input your answer. script05.js var ans=prompt("Are you sure you want to do that?"); if(ans){ alert("You said "+ans); } el原创 2015-09-15 22:23:58 · 476 阅读 · 0 评论 -
{welcome to JS} 无干扰脚本编程
代码如下 hiahiahia Welcome var a=document.getElementById('a'); alert(a!==null);// ==>true /* ===表示绝对相等,!==是否表示不绝对相等 例如:null != undefined // 返回false null !== undefined // 返回true原创 2015-09-17 11:36:26 · 624 阅读 · 0 评论 -
{welcome to JS} 第一个web程序
1.用try和case处理错误 welcome10.html Square root window.onload = initAll; function initAll(){ var ans = prompt("Please enter a number bigger than 0: ") // 如果不加【,""】,则输入框会出现un原创 2015-09-19 10:38:53 · 835 阅读 · 0 评论 -
{welcome to JS} 处理图像(翻转器)
1.html A Simple Rollover script1.css body{ background-color: #FFF; } img{ border-width: 0; } img#arrow,imag#arrowImg{ width:147px; height: 82px; } #button1,#button2{ wid原创 2015-10-09 20:44:56 · 680 阅读 · 1 评论