<div class="codetitle"> <span><a style="CURSOR: pointer" data="47582" class="copybut" id="copybut47582" onclick="doCopy('code47582')"><u>複製程式碼</u></a></span> 程式碼如下:</div> <div class="codebody" id="code47582"> <br>function validate ent .getElementById("Button2");<br> btnsave.disabled = false;<br> fileupload = document.getElementById(id);<br> if (fileupload.value.length var agent = window.navigator.userAgent;<br> var isIE7 = agent.indexOf('MSIE 7.0') != -1;<br> var isIE8 = agent.indexOf('MSIE 8.0') ! 🎜> if (isIE7 || isIE8) { <br> fileupload.select();<br> filepath = document.selection.createRange().text;<br> }<br> //IE6獲得文件路徑<br> else<br> { filepath = file.value ; }<br> //PageMethods.ValidateFile(filepath, maxsize, ieCallBack);<br> path; }<br> if (agent.indexOf("Firefox") >= 1) {<br> alert("FF");<br> alse;<br> if (fileupload.files) {<br> 🎜> nerHTML = '<input type="file" name="' fileupload.name '" id="' fileupload.id '" onchange=" disableSave(this);"> ';<br> alert時("檔案超過大小! ");<br> }<br> }<br> }<br> </div>