<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>
无标题页
</title></head>
<body>
    <form name="form1" method="post" action="Default.aspx" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTQxNzA1NjY0MWRkE6LzRxBpVk7xWCOrIjiDJYObxEQ=" />
</div>    <div>
        <br />        &nbsp;</div>
    
    <script type="text/javascript">
    var xmlHttp;
    var key;
    var bar_color="blue";
    
    var filename;
    var filesize;
    var begintime;
function createXmlHttpRequest(){
if(window.ActiveXObject){
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
else if(window.XMLHttpRequest){
xmlHttp=new XMLHttpRequest();
}
}

function go(){
    OpenUpload();
    createXmlHttpRequest();
    checkDiv();
    begintime=new Date();
    var url="../UploadControl/UploadControl/UploadAjax.aspx?task=create"+"&begintime="+begintime.getTime();
    xmlHttp.open("GET",url,true);
    xmlHttp.onreadystatechange=goCallback;
    xmlHttp.send(null);
}

function checkDiv(){
    clearBar();
}

function clearBar(){
    for(var i=1;i<=100;i++){
        var elem=document.getElementById("Span"+i);
        elem.style.backgroundColor="blue";
    }
}

function goCallback(){
    if(xmlHttp.readyState==4)
{
if(xmlHttp.status==200)
{
    setTimeout("pollServer()",1000);
    var xml=xmlHttp.responseXML;
    
    var speed=xml.getElementsByTagName("speed")[0].firstChild.data;
    var spanSpeed=document.getElementById("speed");
    spanSpeed.innerHTML="上传速度:"+speed+"KB/S";
    
    var percent=xml.getElementsByTagName("percent")[0].firstChild.data;
    var spanPercent=document.getElementById("percent");
    spanPercent.innerHTML=percent+"%";
}
}
}

function pollServer(){
    if(xmlHttp==null)
        return;
    var url="../UploadControl/UploadControl/UploadAjax.aspx?task=poll"+"&begintime="+begintime.getTime()+"&now="+new Date().getTime();
    xmlHttp.open("GET",url,true);
    xmlHttp.onreadystatechange=pollCallback;
    xmlHttp.send(null);
}

function pollCallback(){
    if(xmlHttp.readyState==4)
{
if(xmlHttp.status==200)
{
    var xml=xmlHttp.responseXML;
    
    var speed=xml.getElementsByTagName("speed")[0].firstChild.data;
    var spanSpeed=document.getElementById("speed");
    spanSpeed.innerHTML="上传速度:"+speed+"KB/S";
    
    var percent=xml.getElementsByTagName("percent")[0].firstChild.data;
    var spanPercent=document.getElementById("percent");
    spanPercent.innerHTML=percent+"%";
    var percent=parseInt(percent);
    for(var i=1;i<=percent;i++){
        var elem=document.getElementById("Span"+i);
        elem.style.backgroundColor=bar_color;
    }
    if(percent<100){
        setTimeout("pollServer()",1000);
    }
    else
    {
        //CloseUpload();
    }
}
}
}

function CloseUpload(){
    var mask=document.getElementById("mask");
        var progressFrame=document.getElementById("progressBarFrame");
    mask.style.visibility="hidden";
    progressFrame.style.visibility="hidden";
    xmlHttp.abort();
    document.fileuploadframe.location="../UploadControl/UploadControl/UpLoadWindow.aspx";
    xmlHttp=null;
}

function OpenUpload(){
        var allWidth=document.body.clientWidth;
        var mask=document.getElementById("mask");
        var progressFrame=document.getElementById("progressBarFrame");
        mask.style.width=document.body.clientWidth.toString();
        mask.style.height=document.body.clientHeight.toString();
        mask.style.visibility="visible";
        var left=(allWidth-650)/2;
        progressFrame.style.left=left.toString();
        var top=(document.body.scrollTop+window.screen.availHeight-120)/2;
        progressFrame.style.top=top.toString();
        progressFrame.style.visibility="visible";
    }
</script>
<iframe name="fileuploadframe"  frameborder="0" scrolling="no" src="../UploadControl/UploadControl/UpLoadWindow.aspx" width="560px" height="80px">
    
</iframe>

解决方案 »

  1.   


    <div id="mask" style=" visibility:hidden ;color:Red; position:absolute;top:0px; left:0px; z-index:4; border:solid blue 1px;background-color:Blue;filter:ALPHA(opacity=40); width:100%; height:100%">
        <input type="button" id="hiddenbutton" style=" visibility:hidden" onclick="go();" />
    </div>
    <div id="progressBarFrame" style=" visibility:hidden ;position:absolute; text-align:center; vertical-align:middle; z-index:5; border:solid blue 1px;background-color:White;width:650px; height:120px;">
        <div style=" background-color:MenuText"><span id="file_lblComplete">uncomplete</span></div>
        <div style=" text-align:center; font-size:smaller"><span id="speed">上传速度:KB/S</span></div>    <div id="progressBar" style=" border:solid black 1px; width:605px; height:30px; padding:0px; margin:0px">
            <span id="Span1" style=" width:6px; height:100%;"></span>
            <span id="Span2" style=" width:6px; height:100%"></span>
            <span id="Span3" style=" width:6px; height:100%"></span>
            <span id="Span4" style=" width:6px; height:100%"></span>
            <span id="Span5" style=" width:6px; height:100%"></span>
            <span id="Span6" style=" width:6px; height:100%"></span>
            <span id="Span7" style=" width:6px; height:100%"></span>
            <span id="Span8" style=" width:6px; height:100%"></span>        <span id="Span9" style=" width:6px; height:100%"></span>
            <span id="Span10" style=" width:6px; height:100%"></span>
            <span id="Span11" style=" width:6px; height:100%"></span>
            <span id="Span12" style=" width:6px; height:100%"></span>
            <span id="Span13" style=" width:6px; height:100%"></span>
            <span id="Span14" style=" width:6px; height:100%"></span>
            <span id="Span15" style=" width:6px; height:100%"></span>
            <span id="Span16" style=" width:6px; height:100%"></span>
            <span id="Span17" style=" width:6px; height:100%"></span>        <span id="Span18" style=" width:6px; height:100%"></span>
            <span id="Span19" style=" width:6px; height:100%"></span>
            <span id="Span20" style=" width:6px; height:100%"></span>
            <span id="Span21" style=" width:6px; height:100%"></span>
            <span id="Span22" style=" width:6px; height:100%"></span>
            <span id="Span23" style=" width:6px; height:100%"></span>
            <span id="Span24" style=" width:6px; height:100%"></span>
            <span id="Span25" style=" width:6px; height:100%"></span>
            <span id="Span26" style=" width:6px; height:100%"></span>        <span id="Span27" style=" width:6px; height:100%"></span>
            <span id="Span28" style=" width:6px; height:100%"></span>
            <span id="Span29" style=" width:6px; height:100%"></span>
            <span id="Span30" style=" width:6px; height:100%"></span>
            <span id="Span31" style=" width:6px; height:100%"></span>
            <span id="Span32" style=" width:6px; height:100%"></span>
            <span id="Span33" style=" width:6px; height:100%"></span>
            <span id="Span34" style=" width:6px; height:100%"></span>
            <span id="Span35" style=" width:6px; height:100%"></span>        <span id="Span36" style=" width:6px; height:100%"></span>
            <span id="Span37" style=" width:6px; height:100%"></span>
            <span id="Span38" style=" width:6px; height:100%"></span>
            <span id="Span39" style=" width:6px; height:100%"></span>
            <span id="Span40" style=" width:6px; height:100%"></span>
            <span id="Span41" style=" width:6px; height:100%"></span>
            <span id="Span42" style=" width:6px; height:100%"></span>
            <span id="Span43" style=" width:6px; height:100%"></span>
            <span id="Span44" style=" width:6px; height:100%"></span>        <span id="Span45" style=" width:6px; height:100%"></span>
            <span id="Span46" style=" width:6px; height:100%"></span>
            <span id="Span47" style=" width:6px; height:100%"></span>
            <span id="Span48" style=" width:6px; height:100%"></span>
            <span id="Span49" style=" width:6px; height:100%"></span>
            <span id="Span50" style=" width:6px; height:100%"></span>
            <span id="Span51" style=" width:6px; height:100%"></span>
            <span id="Span52" style=" width:6px; height:100%"></span>
            <span id="Span53" style=" width:6px; height:100%"></span>        <span id="Span54" style=" width:6px; height:100%"></span>
            <span id="Span55" style=" width:6px; height:100%"></span>
            <span id="Span56" style=" width:6px; height:100%"></span>
            <span id="Span57" style=" width:6px; height:100%"></span>
            <span id="Span58" style=" width:6px; height:100%"></span>
            <span id="Span59" style=" width:6px; height:100%"></span>
            <span id="Span60" style=" width:6px; height:100%"></span>
            <span id="Span61" style=" width:6px; height:100%"></span>
            <span id="Span62" style=" width:6px; height:100%"></span>        <span id="Span63" style=" width:6px; height:100%"></span>
            <span id="Span64" style=" width:6px; height:100%"></span>
            <span id="Span65" style=" width:6px; height:100%"></span>
            <span id="Span66" style=" width:6px; height:100%"></span>
            <span id="Span67" style=" width:6px; height:100%"></span>
            <span id="Span68" style=" width:6px; height:100%"></span>
            <span id="Span69" style=" width:6px; height:100%"></span>
            <span id="Span70" style=" width:6px; height:100%"></span>
            <span id="Span71" style=" width:6px; height:100%"></span>        <span id="Span72" style=" width:6px; height:100%"></span>
            <span id="Span73" style=" width:6px; height:100%"></span>
            <span id="Span74" style=" width:6px; height:100%"></span>
            <span id="Span75" style=" width:6px; height:100%"></span>
            <span id="Span76" style=" width:6px; height:100%"></span>
            <span id="Span77" style=" width:6px; height:100%"></span>
            <span id="Span78" style=" width:6px; height:100%"></span>
            <span id="Span79" style=" width:6px; height:100%"></span>
            <span id="Span80" style=" width:6px; height:100%"></span>        <span id="Span81" style=" width:6px; height:100%"></span>
            <span id="Span82" style=" width:6px; height:100%"></span>
            <span id="Span83" style=" width:6px; height:100%"></span>
            <span id="Span84" style=" width:6px; height:100%"></span>
            <span id="Span85" style=" width:6px; height:100%"></span>
            <span id="Span86" style=" width:6px; height:100%"></span>
            <span id="Span87" style=" width:6px; height:100%"></span>
            <span id="Span88" style=" width:6px; height:100%"></span>
            <span id="Span89" style=" width:6px; height:100%"></span>        <span id="Span90" style=" width:6px; height:100%"></span>
            <span id="Span91" style=" width:6px; height:100%"></span>
            <span id="Span92" style=" width:6px; height:100%"></span>
            <span id="Span93" style=" width:6px; height:100%"></span>
            <span id="Span94" style=" width:6px; height:100%"></span>
            <span id="Span95" style=" width:6px; height:100%"></span>
            <span id="Span96" style=" width:6px; height:100%"></span>
            <span id="Span97" style=" width:6px; height:100%"></span>
            <span id="Span98" style=" width:6px; height:100%"></span>        <span id="Span99" style=" width:6px; height:100%"></span>
            <span id="Span100" style=" width:6px; height:100%"></span>
        </div>
        <span id="percent"></span><br />
        
        <div>
            <input id="btnStop" type="button" value="停止上传" onclick="CloseUpload();" />
        </div>
    </div>
        </form></body></html>var elem=document.getElementById("Span11");elem.style.backgroundColor="blue";错误: elem is null
    源文件:javascript:%20var%20elem=document.getElementById("Span11");elem.style.backgroundColor="blue";
    行:1
      

  2.   


    <div id="mask" style=" visibility:hidden ;color:Red; position:absolute;top:0px; left:0px; z-index:4; border:solid blue 1px;background-color:Blue;filter:ALPHA(opacity=40); width:100%; height:100%">
        <input type="button" id="hiddenbutton" style=" visibility:hidden" onclick="go();" />
    </div>
    <div id="progressBarFrame" style=" visibility:hidden ;position:absolute; text-align:center; vertical-align:middle; z-index:5; border:solid blue 1px;background-color:White;width:650px; height:120px;">
        <div style=" background-color:MenuText"><span id="file_lblComplete">uncomplete</span></div>
        <div style=" text-align:center; font-size:smaller"><span id="speed">上传速度:KB/S</span></div>    <div id="progressBar" style=" border:solid black 1px; width:605px; height:30px; padding:0px; margin:0px">
            <span id="Span1" style=" width:6px; height:100%;"></span>
            <span id="Span2" style=" width:6px; height:100%"></span>
            <span id="Span3" style=" width:6px; height:100%"></span>
            <span id="Span4" style=" width:6px; height:100%"></span>
            <span id="Span5" style=" width:6px; height:100%"></span>
            <span id="Span6" style=" width:6px; height:100%"></span>
            <span id="Span7" style=" width:6px; height:100%"></span>
            <span id="Span8" style=" width:6px; height:100%"></span>        <span id="Span9" style=" width:6px; height:100%"></span>
            <span id="Span10" style=" width:6px; height:100%"></span>
            <span id="Span11" style=" width:6px; height:100%"></span>
            <span id="Span12" style=" width:6px; height:100%"></span>
            <span id="Span13" style=" width:6px; height:100%"></span>
            <span id="Span14" style=" width:6px; height:100%"></span>
            <span id="Span15" style=" width:6px; height:100%"></span>
            <span id="Span16" style=" width:6px; height:100%"></span>
            <span id="Span17" style=" width:6px; height:100%"></span>        <span id="Span18" style=" width:6px; height:100%"></span>
            <span id="Span19" style=" width:6px; height:100%"></span>
            <span id="Span20" style=" width:6px; height:100%"></span>
            <span id="Span21" style=" width:6px; height:100%"></span>
            <span id="Span22" style=" width:6px; height:100%"></span>
            <span id="Span23" style=" width:6px; height:100%"></span>
            <span id="Span24" style=" width:6px; height:100%"></span>
            <span id="Span25" style=" width:6px; height:100%"></span>
            <span id="Span26" style=" width:6px; height:100%"></span>        <span id="Span27" style=" width:6px; height:100%"></span>
            <span id="Span28" style=" width:6px; height:100%"></span>
            <span id="Span29" style=" width:6px; height:100%"></span>
            <span id="Span30" style=" width:6px; height:100%"></span>
            <span id="Span31" style=" width:6px; height:100%"></span>
            <span id="Span32" style=" width:6px; height:100%"></span>
            <span id="Span33" style=" width:6px; height:100%"></span>
            <span id="Span34" style=" width:6px; height:100%"></span>
            <span id="Span35" style=" width:6px; height:100%"></span>        <span id="Span36" style=" width:6px; height:100%"></span>
            <span id="Span37" style=" width:6px; height:100%"></span>
            <span id="Span38" style=" width:6px; height:100%"></span>
            <span id="Span39" style=" width:6px; height:100%"></span>
            <span id="Span40" style=" width:6px; height:100%"></span>
            <span id="Span41" style=" width:6px; height:100%"></span>
            <span id="Span42" style=" width:6px; height:100%"></span>
            <span id="Span43" style=" width:6px; height:100%"></span>
            <span id="Span44" style=" width:6px; height:100%"></span>        <span id="Span45" style=" width:6px; height:100%"></span>
            <span id="Span46" style=" width:6px; height:100%"></span>
            <span id="Span47" style=" width:6px; height:100%"></span>
            <span id="Span48" style=" width:6px; height:100%"></span>
            <span id="Span49" style=" width:6px; height:100%"></span>
            <span id="Span50" style=" width:6px; height:100%"></span>
            <span id="Span51" style=" width:6px; height:100%"></span>
            <span id="Span52" style=" width:6px; height:100%"></span>
            <span id="Span53" style=" width:6px; height:100%"></span>        <span id="Span54" style=" width:6px; height:100%"></span>
            <span id="Span55" style=" width:6px; height:100%"></span>
            <span id="Span56" style=" width:6px; height:100%"></span>
            <span id="Span57" style=" width:6px; height:100%"></span>
            <span id="Span58" style=" width:6px; height:100%"></span>
            <span id="Span59" style=" width:6px; height:100%"></span>
            <span id="Span60" style=" width:6px; height:100%"></span>
            <span id="Span61" style=" width:6px; height:100%"></span>
            <span id="Span62" style=" width:6px; height:100%"></span>        <span id="Span63" style=" width:6px; height:100%"></span>
            <span id="Span64" style=" width:6px; height:100%"></span>
            <span id="Span65" style=" width:6px; height:100%"></span>
            <span id="Span66" style=" width:6px; height:100%"></span>
            <span id="Span67" style=" width:6px; height:100%"></span>
            <span id="Span68" style=" width:6px; height:100%"></span>
            <span id="Span69" style=" width:6px; height:100%"></span>
            <span id="Span70" style=" width:6px; height:100%"></span>
            <span id="Span71" style=" width:6px; height:100%"></span>        <span id="Span72" style=" width:6px; height:100%"></span>
            <span id="Span73" style=" width:6px; height:100%"></span>
            <span id="Span74" style=" width:6px; height:100%"></span>
            <span id="Span75" style=" width:6px; height:100%"></span>
            <span id="Span76" style=" width:6px; height:100%"></span>
            <span id="Span77" style=" width:6px; height:100%"></span>
            <span id="Span78" style=" width:6px; height:100%"></span>
            <span id="Span79" style=" width:6px; height:100%"></span>
            <span id="Span80" style=" width:6px; height:100%"></span>        <span id="Span81" style=" width:6px; height:100%"></span>
            <span id="Span82" style=" width:6px; height:100%"></span>
            <span id="Span83" style=" width:6px; height:100%"></span>
            <span id="Span84" style=" width:6px; height:100%"></span>
            <span id="Span85" style=" width:6px; height:100%"></span>
            <span id="Span86" style=" width:6px; height:100%"></span>
            <span id="Span87" style=" width:6px; height:100%"></span>
            <span id="Span88" style=" width:6px; height:100%"></span>
            <span id="Span89" style=" width:6px; height:100%"></span>        <span id="Span90" style=" width:6px; height:100%"></span>
            <span id="Span91" style=" width:6px; height:100%"></span>
            <span id="Span92" style=" width:6px; height:100%"></span>
            <span id="Span93" style=" width:6px; height:100%"></span>
            <span id="Span94" style=" width:6px; height:100%"></span>
            <span id="Span95" style=" width:6px; height:100%"></span>
            <span id="Span96" style=" width:6px; height:100%"></span>
            <span id="Span97" style=" width:6px; height:100%"></span>
            <span id="Span98" style=" width:6px; height:100%"></span>        <span id="Span99" style=" width:6px; height:100%"></span>
            <span id="Span100" style=" width:6px; height:100%"></span>
        </div>
        <span id="percent"></span><br />
        
        <div>
            <input id="btnStop" type="button" value="停止上传" onclick="CloseUpload();" />
        </div>
    </div>
        </form></body></html>var elem=document.getElementById("Span11");elem.style.backgroundColor="blue";错误: elem is null
    源文件:javascript:%20var%20elem=document.getElementById("Span11");elem.style.backgroundColor="blue";
    行:1
      

  3.   


    <div id="mask" style=" visibility:hidden ;color:Red; position:absolute;top:0px; left:0px; z-index:4; border:solid blue 1px;background-color:Blue;filter:ALPHA(opacity=40); width:100%; height:100%">
        <input type="button" id="hiddenbutton" style=" visibility:hidden" onclick="go();" />
    </div>
    <div id="progressBarFrame" style=" visibility:hidden ;position:absolute; text-align:center; vertical-align:middle; z-index:5; border:solid blue 1px;background-color:White;width:650px; height:120px;">
        <div style=" background-color:MenuText"><span id="file_lblComplete">uncomplete</span></div>
        <div style=" text-align:center; font-size:smaller"><span id="speed">上传速度:KB/S</span></div>    <div id="progressBar" style=" border:solid black 1px; width:605px; height:30px; padding:0px; margin:0px">
            <span id="Span1" style=" width:6px; height:100%;"></span>
            <span id="Span2" style=" width:6px; height:100%"></span>
            <span id="Span3" style=" width:6px; height:100%"></span>
            <span id="Span4" style=" width:6px; height:100%"></span>
            <span id="Span5" style=" width:6px; height:100%"></span>
            <span id="Span6" style=" width:6px; height:100%"></span>
            <span id="Span7" style=" width:6px; height:100%"></span>        <span id="Span8" style=" width:6px; height:100%"></span>        <span id="Span9" style=" width:6px; height:100%"></span>
            <span id="Span10" style=" width:6px; height:100%"></span>
            <span id="Span11" style=" width:6px; height:100%"></span>
            <span id="Span12" style=" width:6px; height:100%"></span>
            <span id="Span13" style=" width:6px; height:100%"></span>
            <span id="Span14" style=" width:6px; height:100%"></span>
            <span id="Span15" style=" width:6px; height:100%"></span>        <span id="Span16" style=" width:6px; height:100%"></span>
            <span id="Span17" style=" width:6px; height:100%"></span>        <span id="Span18" style=" width:6px; height:100%"></span>
            <span id="Span19" style=" width:6px; height:100%"></span>
            <span id="Span20" style=" width:6px; height:100%"></span>
            <span id="Span21" style=" width:6px; height:100%"></span>
            <span id="Span22" style=" width:6px; height:100%"></span>
            <span id="Span23" style=" width:6px; height:100%"></span>        <span id="Span24" style=" width:6px; height:100%"></span>
            <span id="Span25" style=" width:6px; height:100%"></span>
            <span id="Span26" style=" width:6px; height:100%"></span>        <span id="Span27" style=" width:6px; height:100%"></span>
            <span id="Span28" style=" width:6px; height:100%"></span>
            <span id="Span29" style=" width:6px; height:100%"></span>
            <span id="Span30" style=" width:6px; height:100%"></span>
            <span id="Span31" style=" width:6px; height:100%"></span>        <span id="Span32" style=" width:6px; height:100%"></span>
            <span id="Span33" style=" width:6px; height:100%"></span>
            <span id="Span34" style=" width:6px; height:100%"></span>
            <span id="Span35" style=" width:6px; height:100%"></span>        <span id="Span36" style=" width:6px; height:100%"></span>
            <span id="Span37" style=" width:6px; height:100%"></span>
            <span id="Span38" style=" width:6px; height:100%"></span>
            <span id="Span39" style=" width:6px; height:100%"></span>        <span id="Span40" style=" width:6px; height:100%"></span>
            <span id="Span41" style=" width:6px; height:100%"></span>
            <span id="Span42" style=" width:6px; height:100%"></span>
            <span id="Span43" style=" width:6px; height:100%"></span>
            <span id="Span44" style=" width:6px; height:100%"></span>        <span id="Span45" style=" width:6px; height:100%"></span>
            <span id="Span46" style=" width:6px; height:100%"></span>
            <span id="Span47" style=" width:6px; height:100%"></span>        <span id="Span48" style=" width:6px; height:100%"></span>
            <span id="Span49" style=" width:6px; height:100%"></span>
            <span id="Span50" style=" width:6px; height:100%"></span>
            <span id="Span51" style=" width:6px; height:100%"></span>
            <span id="Span52" style=" width:6px; height:100%"></span>
            <span id="Span53" style=" width:6px; height:100%"></span>        <span id="Span54" style=" width:6px; height:100%"></span>
            <span id="Span55" style=" width:6px; height:100%"></span>        <span id="Span56" style=" width:6px; height:100%"></span>
            <span id="Span57" style=" width:6px; height:100%"></span>
            <span id="Span58" style=" width:6px; height:100%"></span>
            <span id="Span59" style=" width:6px; height:100%"></span>
            <span id="Span60" style=" width:6px; height:100%"></span>
            <span id="Span61" style=" width:6px; height:100%"></span>
            <span id="Span62" style=" width:6px; height:100%"></span>        <span id="Span63" style=" width:6px; height:100%"></span>        <span id="Span64" style=" width:6px; height:100%"></span>
            <span id="Span65" style=" width:6px; height:100%"></span>
            <span id="Span66" style=" width:6px; height:100%"></span>
            <span id="Span67" style=" width:6px; height:100%"></span>
            <span id="Span68" style=" width:6px; height:100%"></span>
            <span id="Span69" style=" width:6px; height:100%"></span>
            <span id="Span70" style=" width:6px; height:100%"></span>
            <span id="Span71" style=" width:6px; height:100%"></span>        <span id="Span72" style=" width:6px; height:100%"></span>
            <span id="Span73" style=" width:6px; height:100%"></span>
            <span id="Span74" style=" width:6px; height:100%"></span>
            <span id="Span75" style=" width:6px; height:100%"></span>
            <span id="Span76" style=" width:6px; height:100%"></span>
            <span id="Span77" style=" width:6px; height:100%"></span>
            <span id="Span78" style=" width:6px; height:100%"></span>
            <span id="Span79" style=" width:6px; height:100%"></span>
            <span id="Span80" style=" width:6px; height:100%"></span>        <span id="Span81" style=" width:6px; height:100%"></span>
            <span id="Span82" style=" width:6px; height:100%"></span>
            <span id="Span83" style=" width:6px; height:100%"></span>
            <span id="Span84" style=" width:6px; height:100%"></span>
            <span id="Span85" style=" width:6px; height:100%"></span>
            <span id="Span86" style=" width:6px; height:100%"></span>
            <span id="Span87" style=" width:6px; height:100%"></span>
            <span id="Span88" style=" width:6px; height:100%"></span>        <span id="Span89" style=" width:6px; height:100%"></span>        <span id="Span90" style=" width:6px; height:100%"></span>
            <span id="Span91" style=" width:6px; height:100%"></span>
            <span id="Span92" style=" width:6px; height:100%"></span>
            <span id="Span93" style=" width:6px; height:100%"></span>
            <span id="Span94" style=" width:6px; height:100%"></span>
            <span id="Span95" style=" width:6px; height:100%"></span>
            <span id="Span96" style=" width:6px; height:100%"></span>        <span id="Span97" style=" width:6px; height:100%"></span>
            <span id="Span98" style=" width:6px; height:100%"></span>        <span id="Span99" style=" width:6px; height:100%"></span>
            <span id="Span100" style=" width:6px; height:100%"></span>
        </div>
        <span id="percent"></span><br />
        
        <div>
            <input id="btnStop" type="button" value="停止上传" onclick="CloseUpload();" />    </div>
    </div>
        </form></body></html>
    错误: elem is null
    源文件:javascript:%20var%20elem=document.getElementById("Span11");elem.style.backgroundColor="blue";
    行:1
      

  4.   

    看情况应该是在调用时,将空格URL编码了(%20),
    先修改脚本,避免空格function clearBar(){
            for(var i=1;i<=100;i++){
                var elem=document.getElementById("Span"+i);
                elem.style.backgroundColor="blue";
            }
        }改为function clearBar(){
      for(var i=1;i<=100;i++){document.getElementById("Span"+i).style.backgroundColor="blue";}
    }看还有没有出错,若仍出错,
    请查看一下文档中哪里调用了函数clearBar();
    再议
      

  5.   


    javascript:document.getElementById("Span11").style.backgroundColor='blue';