2009-07-17 15 views
1

SWFUploadのSimpleUploadデモから変更された次のjavascriptコードがあります。これは、一時的なアップロードプログレスバーを生成するために使用されます。コメントアウトされているコードを追加しない限り、正常に動作します。基本的に、この行はプレゼンテーションを中断します:javascriptを使用してhtml要素を追加すると、他のjsが作成されます。

this.fileProgressElement.appendChild(document.createTextNode( "アップロードステータス"));

デモ:アップロードを試してください。アップロード機能が動作しません。
http://www.mgxvideo.com/mgxcopy-dev/uploader-works/upload_files.php
http://www.mgxvideo.com/mgxcopy-dev/uploader-broken/upload_files.php

コードは次のとおりです。
http://www.mgxvideo.com/mgxcopy-dev/uploader-works/js/sample1.txt
http://www.mgxvideo.com/mgxcopy-dev/uploader-broken/js/sample1.txt

function FileProgress(file, targetID) { 
    this.fileProgressID = file.id; 

    this.opacity = 100; 
    this.height = 0; 


    this.fileProgressWrapper = document.getElementById(this.fileProgressID); 
    if (!this.fileProgressWrapper) { 
     this.fileProgressWrapper = document.createElement("div"); 
     this.fileProgressWrapper.className = "progressWrapper"; 
     this.fileProgressWrapper.id = this.fileProgressID; 

     this.fileProgressElement = document.createElement("div"); 
     this.fileProgressElement.className = "progressContainer"; 
     //this.fileProgressElement.appendChild(document.createTextNode("Upload Status")); 

     var progressCancel = document.createElement("a"); 
     progressCancel.className = "progressCancel"; 
     progressCancel.href = "#"; 
     progressCancel.style.visibility = "hidden"; 
     progressCancel.appendChild(document.createTextNode(" ")); 

     var progressText = document.createElement("div"); 
     progressText.className = "progressName"; 
     progressText.appendChild(document.createTextNode(file.name)); 

     var progressBar = document.createElement("div"); 
     progressBar.className = "progressBarInProgress"; 

     var progressStatus = document.createElement("div"); 
     progressStatus.className = "progressBarStatus"; 
     progressStatus.innerHTML = " "; 

     var progressFull = document.createElement("div"); 
     progressFull.className = "progressBarFull"; 
     progressFull.innerHTML = " "; 

     this.fileProgressElement.appendChild(progressCancel); 
     this.fileProgressElement.appendChild(progressText); 
     this.fileProgressElement.appendChild(progressStatus); 
     this.fileProgressElement.appendChild(progressBar); 
     this.fileProgressElement.appendChild(progressFull); 
     this.fileProgressWrapper.appendChild(this.fileProgressElement); 

     document.getElementById(targetID).appendChild(this.fileProgressWrapper); 
    } else { 
     this.fileProgressElement = this.fileProgressWrapper.firstChild; 
     this.reset(); 
    } 

    this.height = this.fileProgressWrapper.offsetHeight; 
    this.setTimer(null); 


} 
+1

「この行はプレゼンテーションを破ります」とはどういう意味ですか?私はfirefox 3.0.xとIE8で両方のバージョンをテストしており、明らかに壊れている/間違っているものは見当たりませんでした。 – VolkerK

+0

私はすべてのDOM操作の問題で尋ねる質問:DOMがロードされていることを確かめていますか? – geowa4

+0

彼らは私と同じように見えます。それぞれは約45%にアップロードされ、ロックされています。タブを閉じると、ブラウザが数秒間フリーズしました。 WinXP SP3のChrome 2 – NickFitz

答えて

0

は、任意のより良い次の作業をしていますか?

​​
関連する問題