js4:with,for in语句,windows,location对象的使用
原文发布时间为:2008-11-08 —— 来源于本人的百度文章 [由搬家工具导入]
<html>
<head>
<title>js</title>
<script type="text/JavaScript">
<!--
function Car(make,model,color){
this.make=make;
this.model=model;
this.color=color;
}
function openthat(){
window.open("js3.html","that","height=300,width=400,toolbar=yes,scrollbars=yes,directories=yes,location=yes menubar=yes,resizable=no,status=yes");
}
function timeout(){
document.write("time over");
}
function showdate(){
var dt=new Date();
document.getElementById("stime").innerText=dt.getSeconds();
}
var st=setInterval("showdate();",1000);
//-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><style type="text/css">
<!--
-->
</style></head>
<body background="../../图片/女孩子啊/de4149086dd0f2c562d98610.jpg">
<script type="text/JavaScript">
<!--
var car=new Car();
car.make="china";
car.model="003";
car.color="red";
for(var prop in car){
if(prop=="model")
continue;
document.write(prop+"="+car[prop]+"<br>");
}
var car2=new Car();
with(car2){
make="English";
model="009";
color="yellow";
}
for(var prop in car2){
document.write(prop+"="+car2[prop]+"<br>");
}
//var tm=setTimeout("timeout();",3000);
//-->
</script>
<a href="#" onClick="openthat();">js3de</a>
<br>
<a href="#" onClick="window.open('js3.html');">open</a>
<input type=button name="quit" value="close" onClick="window.close();">
<!-- <input type=button name="not" value="donot" onClick="clearTimeout(tm);"> -->
<p> </p>
<p><span id="stime"></span>
<input type=button name="stop" value="stop" onClick="clearInterval(st);">
<input type="button" name="goto" Value="GO TO" onClick="parent.js3.location.href='http://www.baidu.com'">
<input type="button" name="goto" Value="Reflesh" onClick="parent.location.reload(true);">
<input type="button" name="goto" Value="Replace" onClick="parent.js3.location.replace('http://www.baidu.com');">
<input type="button" name="who" Value="frames" onClick="parent.frames[1].location.replace('http://www.baidu.com');">
</p>
<p> </p>
</body>
</html>
js4:with,for in语句,windows,location对象的使用的更多相关文章
- 2016/2/22 1、DOM的基本概念 2、Window对象操作 3、Windows.history对象 4、Window.location对象 5、Window.status对象
1.DOM的基本概念 DOM是文档对象模型,这种模型为树模型:文档是指标签文档:对象是指文档中每个元素:模型是指抽象化的东西. 2.Window对象操作 一.属性和方法: 属性(值或者子对象): op ...
- 【2017-03-28】JS基础、windows对象、history对象、location对象
一.JS基础 JS - javaScript 1.js功能: 1).进行数据的运算.2).控制浏览器的一些功能.3).控制元素(属性.内容.样式) js引用位置: 可以放在html页的任意位置. 推荐 ...
- History对象和location对象
history对象 History对象包含用户在浏览器窗口中访问过的url.不是所有浏览器都支持该对象. 属性length 返回浏览器历史列表中的URL数量. 方法:back() 加载histor ...
- JavaScript -- 时光流逝(十):Screen 对象、History 对象、Location 对象
JavaScript -- 知识点回顾篇(十):Screen 对象.History 对象.Location 对象 1. Screen 对象 1.1 Screen 对象的属性 (1) availHeig ...
- JS BOM对象 History对象 Location对象
一.BOM对象 BOM(浏览器对象模型),可以对浏览器窗口进行访问和操作 window对象 所有浏览器都支持 window 对象. 概念上讲.一个html文档对应一个window对象. 功能上讲: 控 ...
- JS 中document.URL 和 windows.location.href 的区别
实际上,document 和 windows 这两个对象的区别已经包含了这个问题的答案. document 表示的是一个文档对象,windows 表示一个窗口对象. 一个窗口下面可以有很多的docu ...
- js 的Location对象
Location对象 location用于获取或设置窗体的URL,并且可以用于解析URL. 语法: location.[属性|方法] location对象属性图示: location 对象属性: ha ...
- location对象
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- 使用Location对象查询字符串参数
location是BOM中最有用的对象之一: 1.它提供了与当前窗口中加载的文档有关的信息: 2.他还提供了一些导航功能. location对象的属性有: hash, host, hostname, ...
- BOM之location对象
定义 location提供了与当前窗口中加载的文档有关的信息,还提供了一些导航功能.location是一个很特别的对象,因为它既是window对象的属性,也是document对象的属性.换句话说,wi ...
随机推荐
- jstl(c)标签
一.EL表达式: Expression Language提供了在 JSP 脚本编制元素范围外(例如:脚本标签)使用运行时表达式的功能.脚本编制元素是指页面中能够用于在JSP 文件中嵌入 Java 代码 ...
- k8s的ingress资源简述
ingress controller是独立与controller-manager的Ingress的主要作用是可以利用nginx,haproxy,envoy,traefik等负载均衡器来暴露集群内部服务 ...
- go包的理解
结论: import时指定的字符串,是相对于$GOPATH的目录路径,告诉了go,要去加载这个目录下所有的包文件(不包括子目录中的文件) 一个目录中所有的源文件(不包括子目录)代表了单独的一个包,这些 ...
- JAVA连接数据库,并写入到txt文件
package Hello; import java.io.BufferedReader;import java.io.BufferedWriter;import java.io.File;impor ...
- poj 3292 H-素数问题 扩展艾氏筛选法
题意:形似4n+1的被称作H-素数,两个H-素数相乘得到H-合成数.求h范围内的H-合成数个数 思路: h-素数 ...
- [项目1] bloger - day1
项目代码:https://github.com/venicid/Project1--Bloger 1.准备工作 1.创建project PS C:\Users\Administrator\Deskto ...
- jquery 如何实现回顶部 带滑动效果
$("#returnTop").click(function () { var speed=200;//滑动的速度 $('body,html').animate({ scrollT ...
- 【Plus One】cpp
题目: Given a non-negative number represented as an array of digits, plus one to the number. The digit ...
- Selenium 中 高亮元素
//高亮元素 WebElement element = driver.findElement(By.cssSelector(".table1 .btn-public label" ...
- VMware Fusion Pro安装Ubuntu 18.04.1