<html>
<head> </head>
<body>
<script>
function loadScript(url, callback){
var script = document.createElement("script")
script.type = "text/javascript";
if (script.readyState){ //IE
script.onreadystatechange = function(){
if (script.readyState == "loaded" || script.readyState == "complete"){
script.onreadystatechange = null;
callback();
}
};
} else { //Others
script.onload = function(){
callback();
};
}
script.src = url;
document.getElementsByTagName("head")[0].appendChild(script);
}
loadScript("http://www.x.com", function(){
loadScript("http://www.xu.net", function(){
loadScript("http://www.shum.org", function(){
alert("All files are loaded!");
});
});
}); </script>
</body> </html>
<html>
<head> </head>
<body>
<iframe id="if" ></iframe>
<script language="javascript" type="text/javascript">
//var ifr = document.createElement("iframe");
var ifr = document.getElementById("if");
//ifr.align='center';
//ifr.marginwidth=1;
//ifr.marginheight=1;
//ifr.frameborder=0;
//ifr.scrolling="No";
//ifr.width =1007;
//ifr.height=3800;
ifr.src = 'http://www.xueg.com';
if (ifr.attachEvent){
ifr.attachEvent("onload", function(){
//alert("Local if is now loaded attachEvent.");
var iframe = document.createElement('iframe'); //
iframe.src="http://www.baidu.com"; //
document.body.appendChild(iframe); //
});
} else {
ifr.onload = function(){
alert("Local if is now loaded.");
};
}
</script> <script type="text/javascript">
//$LAB
//.script("script3.js").wait()
////.script("script2-a.js")
////.script("script2-b.js")
//.wait(function(){
////initScript3();
////initScript2();
//})
//.script("script1.js")
//.wait(function(){
//initScript1();
//});
</script> </body>
</html>
<!--
var frame = document.getElementById("框架id");
frame.onreadystatechange = function(){
if( this.readyState == "complete" )
alert("加载完毕!");
}
//-->

测试JS的更多相关文章

  1. HTMLPage测试js通过ajax调用

    HTMLPage测试js通过ajax调用接口 <!DOCTYPE html> <html lang="en" xmlns="http://www.w3. ...

  2. 利用Js的console对象,在控制台打印调式信息测试Js

    一次偶然的机会,打开百度的时候按下了F12,然后就见控制台里面输出了百度的招聘广告,感觉挺帅气的,再然后就有了这篇博文. 既然可以这样在控制台输出信息,那以后再调试Js的时候不就可以省去很多麻烦了嘛! ...

  3. 测试JS基本类型以及对象的引用

    自己敲的. 1 <script src="https://ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js&qu ...

  4. try 、catch 、finally 、throw 测试js错误

    try语句允许我们定义在执行时进行错误测试的代码块. catch 语句允许我们定义当 try 代码块发生错误时,所执行的代码块. finally 语句在 try 和 catch 之后无论有无异常都会执 ...

  5. 测试Js权限

    '12222' 测试一下 刚兴趣的可以参考: http://www.cnblogs.com/littledu/archive/2011/05/08/2040298.html http://www.cn ...

  6. 测试JS方法运行时间

    console.time(label) 和 console.timeEnd(label), 在开始的地方写上 console.time("测试 fn 速度: ") ,在结束的地方写 ...

  7. angularJS入门小Demo【简单测试js代码的方法】

    1.首先建立一个文件夹 demo, 2.在其中建立一个文本文档,改名为 demo-1.html, 3.把html中要引入的 js 文件拷贝到 demo目录下, 4.然后用 Notepadd++ 编辑刚 ...

  8. 测试 js 方法运行时间

    早期测速的时候是这样的,呵呵呵,一开始还挺爽的 function testFunctionTime(fn) { var start = new Date().getTime(); if (fn) fn ...

  9. chrome浏览器测试js函数

    1.直接在console中写入代码 2.既要写函数,又要写执行函数的代码. 不关闭网页,函数能够在内存中存活很久 浏览器都能记住函数. 当然,在其他页面无效.

随机推荐

  1. [转] ArcGIS engine中气泡标注的添加、修改

    小生 原文 ArcGIS engine中气泡标注的添加.修改! 你微微地笑着,不同我说什么话.而我觉得,为了这个,我已等待得久了.                                   ...

  2. IOS 支付宝 SDK 申请

    https://b.alipay.com/order/productDetail.htm?productId=2013080604609654&tabId=4#ps-tabinfo-hash

  3. ASP.NET常用技巧方法代码断

    1. 打开新的窗口并传送参数:传送参数:response.write("<script>window.open('*.aspx?id="+this.DropDownLi ...

  4. springmvc基础知识

    springmvc框架,类似于struts,主要用于MVC的控制层 spring的简单配置(非注解):  spring-mvc.xml文件(springMVC框架的基本文件) web.xml文件 ja ...

  5. 修改MongoDb的 DB 和 Log 存储路径 (Windows)-摘自网络

    Create a file called mongod.cfg in MongoDB folder if you dont have it. In my case: C:\Users\ivanbtru ...

  6. 基于Node.js的实时推送 juggernaut

    基于Node.js的实时推送 juggernaut Juggernaut 基于 Node.js 构建.为浏览器和服务器端提供一个实时的连接,可在客户端和服务器端进行数据的实时推送,适合多角色游戏.聊天 ...

  7. J2EE开发常用开源框架技术(转)

    1持久层:1)Hibernate这个不用介绍了,用的很频繁,用的比较多的是映射,包括继承映射和父子表映射对 于DAO在这里介绍个在它基础上开发的包bba96,目前最新版本是bba96 2.0它对Hib ...

  8. java的Socket通信例子及关于java.net.SocketException: Socket is closed错误

    今天写socket数据相互通信的时候,碰到一个及其蛋疼的错误.单向传输数据的时候server与client是没有问题的,但是两个都有输入输出操作的时候就出现了这个问题 java.net.SocketE ...

  9. HDU 5754 Life Winner Bo (博弈)

    Life Winner Bo 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5754 Description Bo is a "Life W ...

  10. jquery easyui的layout

    1.创建一个布局:layout是一个容器,它有5个区域:north(北),south(南),east(东),west(西):center(中)-----------学习中文网地址 <body c ...