测试JS
<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的更多相关文章
- HTMLPage测试js通过ajax调用
HTMLPage测试js通过ajax调用接口 <!DOCTYPE html> <html lang="en" xmlns="http://www.w3. ...
- 利用Js的console对象,在控制台打印调式信息测试Js
一次偶然的机会,打开百度的时候按下了F12,然后就见控制台里面输出了百度的招聘广告,感觉挺帅气的,再然后就有了这篇博文. 既然可以这样在控制台输出信息,那以后再调试Js的时候不就可以省去很多麻烦了嘛! ...
- 测试JS基本类型以及对象的引用
自己敲的. 1 <script src="https://ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js&qu ...
- try 、catch 、finally 、throw 测试js错误
try语句允许我们定义在执行时进行错误测试的代码块. catch 语句允许我们定义当 try 代码块发生错误时,所执行的代码块. finally 语句在 try 和 catch 之后无论有无异常都会执 ...
- 测试Js权限
'12222' 测试一下 刚兴趣的可以参考: http://www.cnblogs.com/littledu/archive/2011/05/08/2040298.html http://www.cn ...
- 测试JS方法运行时间
console.time(label) 和 console.timeEnd(label), 在开始的地方写上 console.time("测试 fn 速度: ") ,在结束的地方写 ...
- angularJS入门小Demo【简单测试js代码的方法】
1.首先建立一个文件夹 demo, 2.在其中建立一个文本文档,改名为 demo-1.html, 3.把html中要引入的 js 文件拷贝到 demo目录下, 4.然后用 Notepadd++ 编辑刚 ...
- 测试 js 方法运行时间
早期测速的时候是这样的,呵呵呵,一开始还挺爽的 function testFunctionTime(fn) { var start = new Date().getTime(); if (fn) fn ...
- chrome浏览器测试js函数
1.直接在console中写入代码 2.既要写函数,又要写执行函数的代码. 不关闭网页,函数能够在内存中存活很久 浏览器都能记住函数. 当然,在其他页面无效.
随机推荐
- jQuery 制作的Tab标签切换选项卡
基于jQuery实现的一个选项卡效果,重点体现在HTML里没有内联事件处理程序,而是定义在js文件里,做到行为与结构的分离.在实际应用过程中,只要保证选项卡模块结构代码的完整性,就可以任意添加N个同类 ...
- http://jingyan.baidu.com/article/4dc40848e7b69bc8d946f127.html
http://jingyan.baidu.com/article/4dc40848e7b69bc8d946f127.html
- Redrain个人维护并使用的DuiLib和UiLib库源码下载地址
转载请说明原出处:http://blog.csdn.net/zhuhongshu/article/details/40740353,谢谢~~ 我把我自己使用的Duilib库和Uilib库都上传到了Gi ...
- SqlServer中输出错误消息
raiserror('所有参数都不能为空',16,1,@@error)
- LeetCode题解——Integer to Roman
题目: 将整数转换为罗马数字.罗马数字规则可以参考: 维基百科-罗马数字 解法: 类似于进制转换,从大的基数开始,求整数对基数的商和余,来进行转换. 代码: class Solution { publ ...
- C++ 我想这样用(二)
话接上篇,从纯C环境转C++环境需要注意些什么呢? 没错,虽然C++曾号称兼容C,而且很多人甚至觉得C就是C++子集,但是c脑残粉一定知道,两者有很大的不同! 下面这些要点是比较突出的,后期我再补充其 ...
- spring-boot系列:初试spring-boot
部署父工程 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http: ...
- Using FastCGI to Host PHP Applications on IIS 7 -IIS7 怎么配置 PHP5
This article describes how to configure the FastCGI module and PHP to host PHP applications on IIS 7 ...
- windows防火墙无法启动,服务不存在
系统的防火墙无法启动,系统服务里面也没有防火墙的服务,用下面第一种方法,导 入注册表,重启服务器,在服务里面有防火墙的服务了,然后启动就好了,需要重新配置防火墙 在控制面板中启动防火墙的时候提示无法识 ...
- GridControl表头全选操作实现之最优方法
突然发现很久没有写博客了. 昨天整了个Windows Live Writer 就为了以后好好写写博客. 所以,开始咯. 为了积累,也为了分享. 之前在博客园中看到一篇文章:<Winform分页控 ...