动态加载js文件 document.createElement

var Rash=true;
var msg="";
function norash()
{
if (confirm("确定要取消吗"))
Rash=false;
}
 function rashit()
{
setInterval('getrss()',Inttime);
}
function getrss()
{
        if (Rash==true)
        {
        head=document.getElementsByTagName('head').item(0);
        script=document.createElement('script');
        script.src='INCLUDE/AutoUpdate.asp';
        script.type='text/javascript';
        script.defer=true;
        void(head.appendChild(script));
        window.status=msg;
        }
}
rashit();

该文章转载自脚本之家:http://www.jb51.net/html/200610/23/2814.htm

posted @ 2007-04-15 20:38  海浪~~  阅读(2837)  评论(1编辑  收藏  举报