为了账号安全,请及时绑定邮箱和手机立即绑定
慕课网数字资源数据库体验端
JavaScript进阶篇_学习笔记_慕课网
为了账号安全,请及时绑定邮箱和手机立即绑定

JavaScript进阶篇

慕课官方号 页面重构设计
难度入门
时长 8小时55分
  • <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>style样式</title> </head> <body> <h2 id="con">I love JavaScript</H2> <p id="c"> JavaScript使网页显示动态效果并实现与用户交互功能。</p> <input type="button" value="点我隐藏" onclick="b()"> <input type="button" value="点击显示" onclick="e()"> <script type="text/javascript"> var a=document.getElementById("con"); var c=document.getElementById("c"); a.style.color="red"; a.style.backgroundColor="#CCC" function b(){ a.style.display="none"; c.style.display="none"; } function e(){ a.style.display=""; c.style.display=""; } </script> </body> </html>
    查看全部
    0 采集 收起 来源:认识DOM

    2018-03-22

  • <!DOCTYPE html> <html> <head> <title>浏览器对象</title> <meta http-equiv="Content-Type" content="text/html; charset=gkb"/> </head> <body> <!--先编写好网页布局--> <h1>操作成功</h1> <span id="second" >5</span> <span >秒后回到主页</span> <a href="javascript:back();">返回</a> <script type="text/javascript"> var num=document.getElementById("second").innerHTML; //获取显示秒数的元素,通过定时器来更改秒数。 function count() { num--; document.getElementById("second").innerHTML=num; if(num==0) { window.location.assign("www.imooc.com"); } } setInterval("count()",1000); //通过window的location和history对象来控制网页的跳转。 function back() { window.history.back(); } </script> </body> </html>
    查看全部
    0 采集 收起 来源:编程练习

    2018-03-22

  • 事件: onclick:鼠标单击事件 onmouseover:鼠标经过事件 onmouseout:鼠标移开事件 onchange:文本框内容改变事件 onselect:文本框内容被选中事件 onfocus:光标聚集 onblur:光标离开 onload:网页导入 onunload:关闭网页
    查看全部
    0 采集 收起 来源:什么是事件

    2018-02-06

  • screen屏幕 screen.width屏宽 screen.height屏高
    查看全部
  • 浏览器版本信息 navigator.userAgent
    查看全部
    0 采集 收起 来源:userAgent

    2018-02-06

  • 设置或获取窗口URL window.location
    查看全部
    0 采集 收起 来源:Location对象

    2018-02-06

  • 返回下一个浏览页面(当然是你有打开过才有下一个页面啊) history.forward()
    查看全部
  • 返回前一个浏览页面(2个方法) window.history.go(-1) or window.history.back()
    查看全部
  • 浏览器历史 window.history()
    查看全部
    0 采集 收起 来源:History 对象

    2018-02-06

  • 暂停定时器clearTimeout 用法:clearTimeout(setTimeout)
    查看全部
  • 取消计时器 clearInterval()
    查看全部
  • setInterval() 每隔指定的时间执行代码 1s=1000ms
    查看全部
  • <script type="text/javascript"> function count(){ var d = ""; var a=document.getElementById("txt1").value; //获取第一个输入框的值 var b=document.getElementById("txt2").value; //获取第二个输入框的值 var c=document.getElementById("select").value; //获取选择框的值 switch(c) { case "+": //d = a + b; d = parseInt(a)+parseInt(b); break; case "-": d = a-b; break; case "*": d = a*b; break; default: d = a/b; } document.getElementById("fruit").value = d; } </script> </head> <body> 计数器:<input type='text' id='txt1' /> <select id='select'> <option value='+'>+</option> <option value="-">-</option> <option value="*">*</option> <option value="/">/</option> </select> <input type='text' id='txt2' /> <input type='button' value='=' onclick="count()"/> <!--通过 = 按钮来调用创建的函数,得到结果--> <input type='text' id='fruit' /> </body>
    查看全部
    0 采集 收起 来源:编程练习

    2018-03-22

  • onclick 鼠标单击事件 onmouseover 鼠标经过事件 onmouseout 鼠标移开事件 onchange 文本框内容改变事件 onselect 文本框内容被选中事件 onfocus 光标聚集 onblur 光标离开 onload 网页导入 onunload 关闭网页
    查看全部
    0 采集 收起 来源:什么是事件

    2018-02-06

  • function 在函数外声明的变量是全局变量,网页上的所有脚本和函数都能访问它。 var 是局部变量,所以只能在函数内部访问它。(该变量的作用域是局部的)。 JavaScript 变量的生命期从它们被声明的时间开始。 局部变量会在函数运行以后被删除。 全局变量会在页面关闭后被删除。
    查看全部
    0 采集 收起 来源:什么是函数

    2018-02-05

举报

0/150
提交
取消
课程须知
你需要具备HTML、css基础知识,建议同学们也可以想学习下js入门篇,快速认识js,熟悉js基本语法,更加快速入手进阶篇!
老师告诉你能学到什么?
通过JavaScript学习,掌握基本语法,制作简单交互式页面
友情提示:

您好,此课程属于迁移课程,您已购买该课程,无需重复购买,感谢您对慕课网的支持!