| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 4597 人关注过本帖
标题:怎么样让Ajax可以调动JS文件
只看楼主 加入收藏
gyj5210
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2011-4-15
收藏
 问题点数:0 回复次数:0 
怎么样让Ajax可以调动JS文件
怎么样让Ajax可以调动JS文件
<!--这是innerHTML的内容-->

<SCRIPT src="/server.js" type=text/javascript></SCRIPT>



<!--这是server.js的内容-->
//变量调节
var _v;
var _e;
var _s;
var _w;
var _h;
var _p;
var _r;
var _fw;
var _fh;
var theurl1 = "http://www.
var theurl2 = "http://www.
var theurl3 = "http://www.
var theurl4 = "http://www.
var theurl5 = "http://www.
var theurl6 = "http://www.
var webServer = "http://www.
var dt = new Date();
var hr = dt.getSeconds();
hr = hr%6;
if(hr==5) {webServer=theurl6; }
if(hr==4) {webServer=theurl5; }
if(hr==3) {webServer=theurl4; }
if(hr==2) {webServer=theurl3; }
if(hr==1) {webServer=theurl2; }
if(hr==0) {webServer=theurl1; }
_p = flashpath.toLowerCase();
_p = webServer + _p;

var _r = /^(.+)(\..+?)(\?.+)?$/;
_e = _r.exec(_p)[2];
//函数
function _addiv(){
    document.write('<div id="play"><div id="flashb" style="border:#E3E3E3 background:#000;display:none;"></div><div id="flashd" style="border:#E3E3E3 background:#000;display:none;"></div><div id="flashc" style="display:none;"></div></div>');   
}
function _resize(w, h, m){
    _fw = 608;
    _fh = 457;
    _w = w;
    _h = h;
    if( m > 0){
        if(w < flashwidth){w = flashwidth;}
        if(h < flashheight){h = flashheight;}
    }else{
        if(w >712){w = 712;}   
    }
    if(_fw < _w){_fw = _w;}
    if(_fh < _h){_fh = _h;}
}
function _showf(_w, _h, _fw, _fh, _p, _v, _e){
    if(_e == '.htm' || _e == '.html'){
        _s = '<iframe frameborder="0" marginwidth="0" marginheight="0" width="'+ _w +'" height="'+ _h +'" scrolling="no" src="'+ _p +'"></iframe>';
    }else if(_e == '.swf'){
        if(_v == null){
            _s = '<object id="flashobj" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.,0,19,0" width="'+ _w +'" height="'+ _h +'"><param name="movie" value="'+ _p +'"/><param name="allowScriptAccess" value="always"/><param name="quality" value="high"/><param name="wmode" value="high"><embed src="'+ _p +'" quality="high" pluginspage="http://www. type="application/x-shockwave-flash" width="'+ _w +'" height="'+ _h +'"></embed></object>';
        }else{
            _s = '<object id="flashobj" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.,0,19,0" width="'+ _w +'" height="'+ _h +'"><param name="movie" value="'+ _p +'"/><param name="flashvars" value="'+ _v +'"/><param name="allowScriptAccess" value="always"/><param name="quality" value="high"/><param name="wmode" value="high"/><param name="BGCOLOR" value="#000000" /><embed src="'+ _p +'" flashvars="'+ _v +'" allowScriptAccess="always" quality="high" pluginspage="http://www. type="application/x-shockwave-flash" width="'+ _w +'" height="'+ _h +'" bgcolor="#000000"></embed></object>';
        }
    }else{
        _s = '<div style="line-height:'+ _h +'px;"><a href="'+ _p +'" target="_blank">下载该文件</a></div>';   
    }
    document.getElementById('flashb').style.width = _fw + 'px';
    document.getElementById('flashb').style.height = _fh + 'px';
    if(_fh > _h){
        document.getElementById('flashb').style.paddingTop = Math.ceil((_fh - _h)/2) + 'px';
    }
    document.getElementById('flashb').innerHTML = _s;
    document.getElementById('process').innerHTML = '<div style="text-align: center;background-color: #000000;font-size: 12px;width: 590px;color: #FFFFFF;padding-top: 3px;"><div id="framecount" style="float:right;width:60px;color:#01A6DE;font-weight:bold;text-align:right;"></div><div style="float:left;width:60px;color:#01A6DE;font-weight:bold;text-align:left;">进度条:</div><div style="float:left;width:458px;"><div id="barborder" style="border:#333 1px solid;height:6px;margin-top:3px;"><div id="bar" style="float:left;font-size:3px;background:#01A6DE;width:0%;height:6px;"></div></div></div></div>';
   
}
function _resizef(_w, _h, _fw, _fh){
    document.getElementById('flashobj').width = _w;
    document.getElementById('flashobj').height = _h;
    document.getElementById('flashb').style.width = _fw + 'px';
    document.getElementById('flashb').style.height = _fh + 'px';
    if(_fh > _h){
        document.getElementById('flashb').style.paddingTop = Math.ceil((_fh - _h)/2) + 'px';
    }else{
        document.getElementById('flashb').style.paddingTop = '0px';
    }
    document.getElementById('flashc').style.width = _fw + 'px';
}
function _showa(_fw, _fh){
    var _rnd = Math.floor(Math.random()*4) + 1;
    var _a1 = '<div style="padding:'+Math.ceil((_fh-400)/2)+'px '+Math.ceil((_fw-550)/2)+'px;"><iframe src="/css/temp/1.htm" height=400 width=550 marginheight=0 marginwidth=0 frameborder=0 scrolling=no></iframe></div>';
    var _a2 = '<div style="padding:'+Math.ceil((_fh-400)/2)+'px '+Math.ceil((_fw-550)/2)+'px;"><iframe src="/css/temp/2.htm" height=400 width=550 marginheight=0 marginwidth=0 frameborder=0 scrolling=no></iframe></div>';
    var _a3 = '<div style="padding:'+Math.ceil((_fh-400)/2)+'px '+Math.ceil((_fw-550)/2)+'px;"><iframe src="/css/temp/3.htm" height=400 width=550 marginheight=0 marginwidth=0 frameborder=0 scrolling=no></iframe></div>';
    var _a4 = '<div style="padding:'+Math.ceil((_fh-400)/2)+'px '+Math.ceil((_fw-550)/2)+'px;"><iframe src="/css/temp/4.htm" height=400 width=550 marginheight=0 marginwidth=0 frameborder=0 scrolling=no></iframe></div>';
    var _a;
    _a = eval('_a'+_rnd);
    if(location.href.indexOf('/localhost/')>0 || document.referrer.indexOf('localhost')>0){
        _a = '<div style="padding:'+Math.ceil((_fh-290)/2)+'px '+Math.ceil((_fw-345)/2)+'px;"><IFRAME WIDTH=345 HEIGHT=290 MARGINWIDTH=0 MARGINHEIGHT=0 FRAMEBORDER=0 SCROLLING=no SRC=/css/temp/5.htm></IFRAME></div>'
    }
    document.getElementById('flashd').style.width = _fw + 'px';
    document.getElementById('flashd').style.height = _fh + 'px';
    document.getElementById('flashd').innerHTML = _a;
}
_addiv();
_resize(flashwidth, flashheight, 0);
_showa(_fw, _fh);
_showf(_w, _h, _fw, _fh, _p, _v, _e);
if(document.getElementById('loc')){
    document.getElementById('loc').value = location.href+'?clip';
}
//进度控制
if((navigator.userAgent.toLowerCase().indexOf("opera")!=-1)||(navigator.userAgent.toLowerCase().indexOf("firefox")!=-1)){
    document.getElementById('flashb').style.display = '';
    document.getElementById('flashc').style.display = '';
}else{
    var _time = 0;
    var _movie = document.getElementById('flashobj');
    var _bar = document.getElementById('bar');
    var _count = document.getElementById('framecount');
     var _nid = setTimeout('_progress()',1000);
 }
 function _progress(){
    var _loaded;
    if(_movie){
        _loaded = _movie.PercentLoaded();
    }else{
        _loaded = 100;
    }
    _bar.style.width =_loaded + '%';
    if(_loaded == 100){
        _count.innerText = '下载完毕';
        if(_time >=6000){
            clearTimeout(_nid);
                                                   document.getElementById('flashb').style.display = '';
            document.getElementById('flashd').style.display = 'none';
            document.getElementById('flashd').innerHTML = '';
            document.getElementById('flashc').style.display = '';
        }else{
            document.getElementById("flashd").style.display = '';
            document.getElementById('flashb').style.display = 'none';
            _nid = setTimeout('_progress()',300);
        }
    }else{
        if (_time >= 10000) {
            document.getElementById('flashb').style.display = '';
            document.getElementById('flashd').style.display = 'none';
            document.getElementById('flashd').innerHTML = '';
            document.getElementById('flashc').style.display = '';
        }else{
            document.getElementById("flashd").style.display = '';
            document.getElementById('flashb').style.display = 'none';
        }
        _nid = setTimeout('_progress()',300);
        _count.innerText = '载入中<<';
    }
    _time = _time + 300;
}
//缩放函数
搜索更多相关主题的帖子: javascript 
2011-04-15 08:59
快速回复:怎么样让Ajax可以调动JS文件
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.033954 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved