<div class="codetitle"> <span><a style="CURSOR: pointer" data="73588" class="copybut" id="copybut73588" onclick="doCopy('code73588')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code73588"> <br>window["MzBrowser"] ={}; <br>(function() <br>{ <br>if(MzBrowser.platform) return; <br>var ua = window.navigator.userAgent; <br>MzBrowser.platform = window.navigator.platform; <br>MzBrowser.firefox = ua.indexOf("Firefox") > 0; <br>MzBrowser.opera = typeof(window.opera) == "object"; <br>MzBrowser.ie = ! MzBrowser.opera && ua.indexOf("MSIE") > 0; <br>MzBrowser.mozilla = window.navigator.product == "Gecko"; <br>MzBrowser.netscape = window.navigator.vendor == "Netscape"; <br>MzBrowser.safari = ua.indexOf("Safari") > - 1; <br>if(MzBrowser.firefox) var re = /Firefox(\s|\/)(\d+(\.\d+)?)/; <br>else if(MzBrowser.ie) var re = /MSIE( )(\d+(\.\d+)?)/; <br>else if(MzBrowser.opera) var re = /Opera(\s|\/)(\d+(\.\d+)?)/; <br>else if(MzBrowser.netscape) var re = /Netscape(\s|\/)(\d+(\.\d+)?)/; <br>else if(MzBrowser.safari) var re = /Version(\/)(\d+(\.\d+)?)/; <br>else if(MzBrowser.mozilla) var re = /rv(\:)(\d+(\.\d+)?)/; <br>if("undefined" != typeof(re) && re.test(ua)) <br>MzBrowser.version = parseFloat(RegExp.$2); <br>} <br>)(); <br>function upLoadKey(e, object) <br>{ <br>if((document.all) ? true : false) <br>{ <br>window.event.keyCode == 9 ? (window.event.returnValue = true) : (window.event.returnValue = false); <br>} <br>else <br>{ <br>if(object.value == "" && typeof e.which == "number")e.preventDefault(); <br>if(object.value != "") object.blur(); <br>} <br>} <br>function version(object) <br>{ <br>if(MzBrowser.firefox && MzBrowser.version == 2)object.blur(); <br>} <br>function clearValue(id) <br>{ <br>var up = (typeof id == "string") ? document.getElementById(id) : id; <br>if (typeof up != "object") return null; <br>var tt = document.createElement("span"); <br>tt.id = "__tt__"; <br>up.parentNode.insertBefore(tt, up); <br>var tf = document.createElement("form"); <br>tf.appendChild(up); <br>document.getElementsByTagName("body")[0].appendChild(tf); <br>tf.reset(); <br>tt.parentNode.insertBefore(up, tt); <br>tt.parentNode.removeChild(tt); <br>tt = null; <br>tf.parentNode.removeChild(tf); <br>} <br> </div> <br>// 页面代码 <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="65302" class="copybut" id="copybut65302" onclick="doCopy('code65302')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code65302"> <br> <br> <br><script language="javascript" src="upLoad.js"></script> <br> <br> <br><input name="textfield3" type="file" class="input" id="textfield3" size="30" value="" ondrag="return false;" oncut="return false;" onkeydown="upLoadKey(event,this);" onpaste="return false;" onmousedown="document.oncontextmenu = function() { return false;}" onmouseout="document.oncontextmenu = function() { return true;};version(this);" tabindex="-1/"> <input type="button" id="clear" value="清 空" onclick="clearValue('textfield3');"> <br> <br> <br> </div>