测试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.既要写函数,又要写执行函数的代码. 不关闭网页,函数能够在内存中存活很久 浏览器都能记住函数. 当然,在其他页面无效.
随机推荐
- [Everyday Mathematics]20150108
设 $f$ 在 $(a,b)$ 上 $n+1$ 次可导, 且 $$\bex \ln\frac{f(b)+f'(b)+\cdots+f^{(n)}(b)}{f(a)+f'(a)+\cdots+f^{(n ...
- Mysql 多表联合查询效率分析及优化
1. 多表连接类型 1. 笛卡尔积(交叉连接) 在MySQL中可以为CROSS JOIN或者省略CROSS即JOIN,或者使用',' 如: SELECT * FROM table1 CROSS JO ...
- Android中GridView滚动到底部加载数据终极版
之前在项目中有一个需求是需要GridView控件,滚动到底部自动加载.但是呢GridView控件并不提供诸如ListView监听滚动到底部的onScrollListener方法,为了实现这样一个效果, ...
- 【原创】用python实现shell的tail操作
在工作过程中发现监控实时刷新文件时,不是那么的任性. 故结合shell中的tail,做了一个类似tail的python脚本. 详情如下: #!/usr/bin/env python #coding=u ...
- LightOJ 1427 -Repository(ac自动机)
题意: 求每个模式串在母串中出现的次数 #include <map> #include <set> #include <list> #include <cma ...
- 【LeetCode 209】Minimum Size Subarray Sum
Given an array of n positive integers and a positive integer s, find the minimal length of a subarra ...
- Spring 中context.start作用
我们经常会看到 如下代码 ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(configPath. ...
- HDU5734:Acperience(方差)
题意: 给出n个数xi,确定一个值α,使得Σ(xi-α)^2的值最小. 分析: 可以猜想是方差,不懂得可以去方差了解一下. 那么α即为∑(xi)/n,然后要注意的是转化为分数,首先我们不能用小数转分数 ...
- Junit3.8 私有方法测试
1. 测试类的私有方法时可以采取两种方式:1) 修改方法的访问修饰符,将private修改为default或public(但不推荐采取这种方式).2) 使用反射在测试类中调用目标类的私有方法(推荐). ...
- POJ动态规划题目列表
列表一:经典题目题号:容易: 1018, 1050, 1083, 1088, 1125, 1143, 1157, 1163, 1178, 1179, 1189, 1191,1208, 1276, 13 ...