笔记:js对象
来源:互联网 发布:python exit code非0 编辑:程序博客网 时间:2024/06/04 00:40
navigator 管理者浏览器的版本号和使用的语言等信息
window 处于顶级位置,每个对象代表一个浏览器窗口
location 含有当前网页的url地址
document 含有当前网页的各种特性
history 含有以前访问过的网页的url地址
--------------------navigator
1.appName
2.appCodename
3.appVerson
<script language="javascript">document.write(navigator.appName + "<br>" + navigator.appCodename + "<br>" + navigator.appVerson);</script>
--------------------window
window.confirm("....") //弹出确定框
window.prompt("....", '0') //弹出提示框
window.alert(...); //警告窗口
window.open(url, name, features); //打开浏览器窗口
<script language="javascript">function checkform() {if(confirm("确定提交吗?"))return true;else return false;}</script><form name="form1" action="2.html" method="post" onsubmit="return checkform()"><input type="submit" value="提交" /></form>
<script language="javascript">var a, b;var c=0;a=prompt("input a number:", '0');//0为默认值b=prompt("input a number:", '0');c=parseInt(a)+parseInt(b);document.write(a+"+"+b+"="+c);</script>
<script language="javascript">function MM_popMsg(msg){alert(msg);}</script><a href="#" onmousedown="MM_popMsg('弹出了一个警告框也!')">弹出警告框</a>
<script language="javascript">function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features);}</script><img src="images/1.jpg"/><img src="images/1.jpg" onclick="MM_openBrWindow('images/1.jpg','放大的图片','toolbar=yes,width=800,height=800')" />
---------------------------------------location
<script language="javascript">document.write(location.href);document.write(location.host);document.write(location.hostname);document.write(location.port);document.write(location.protocal);</script>
<script language="javascript">document.write(location.href +"<br>");document.write(location.host +"<br>");document.write(location.hostname +"<br>");document.write(location.port +"<br>");document.write(location.protocal +"<br>");document.write(location.search +"<br>");document.write(location.pathname +"<br>");</script><form action="#" method="post"> <input type="button" onclick="window.location.search='a+b+c';" value="search"/> <input type="button" onclick="window.location.href='2.html';" value="href"/> </form>
-----------------------history
<form action="#" method="post"> <input type="button" value="前进1" onclick="history.forward()" /> <input type="button" value="后退1" onclick="history.back()" /></form>
<form action="#" method="post"> <input type="button" value="前进2" onclick="history.go(1)" /> <input type="button" value="后退2" onclick="history.go(-1)" /></form>
---------------------------document
script language="javascript">function xxx() {window.alert(document.links(0).href);//连接的地址window.alert(document.anchors.length);//锚点的长度}</script><a href="http://www.bai.com">baidu</a><a href="javascript:xxx()" >show</a>
<form name="zxw"><input type="text" onchange="document.form1.elements[0].value=this.value;" /></form><form name="form1"><input type="text" onchange="document.forms[0].elements[0].value=this.value;" /></form>
- 笔记:js对象
- js笔记(对象)
- js对象笔记
- js对象笔记(1)
- js对象笔记
- js笔记--面向对象
- JS笔记:面向对象
- 【笔记】JS - RegExp对象
- JS 学习笔记--Object对象
- 【js学习笔记-027】-- 对象
- js内置对象 学习笔记
- 【JS学习笔记】内置对象
- js面向对象学习笔记
- js笔记4内置对象
- JS学习笔记之对象
- js内置对象 学习笔记
- 笔记:js内置对象及自定义对象
- 【js基础】js事件对象学习笔记
- 笔记:函数声明
- 2013年android智能手机599元大战开战
- 一、什么是闭包?
- jQuery代码分析之三 Event
- HDU 1385 Minimum Transport Cost(最短路,打印字典序路径)
- 笔记:js对象
- 白话经典算法系列之九 从归并排序到数列的逆序数对(微软笔试题)
- 实习日志(5):Flex页面“跳转”
- (经典)C语言测试:想成为嵌入式程序员应知道的0x10个基本问题
- zoj 1205.Martian Addition
- 2.最基础Linux设备驱动程序:HelloWorld
- reason: ‘Could not instantiate class named NSLayoutConstraint’
- 黑马程序员 集合框架(二)
- C和C++笔试面试题汇总