Chinaunix首页 | 论坛 | 博客
  • 博客访问: 409052
  • 博文数量: 155
  • 博客积分: 2590
  • 博客等级: 少校
  • 技术积分: 2161
  • 用 户 组: 普通用户
  • 注册时间: 2012-10-25 09:33
文章分类

全部博文(155)

文章存档

2015年(1)

2014年(2)

2013年(55)

2012年(97)

分类: JavaScript

2012-12-27 11:40:59

a.htm的内容  
---------------------------------------------------  
 
 
 
 
 
 
 
  
a.js 的内容  
-------------------------------------------------  
function load_b()  
{  
         // 先把b.js调入  
var head = document.getElementsByTagName('head');  
var testScript = document.createElement('script');  
testScript.src = 'b.js';  
testScript.type = 'text/';  
head[0].appendChild(testScript);  
         // 现在就可以调用b.js中的test()函数了  
test();  
}  
window.onload = load_b;  
   
b.js 的内容  
------------------------------------------------  
function test()  
{  
   alert(bad);  
}  
阅读(1019) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~