复制代码 代码如下:
window["MzBrowser"] ={};
(function()
{
if(MzBrowser.platform) return;
var ua = window.navigator.userAgent;
MzBrowser.platform = window.navigator.platform;
MzBrowser.firefox = ua.indexOf("Firefox") > 0;
MzBrowser.opera = typeof(window.opera) == "object";
MzBrowser.ie = ! MzBrowser.opera && ua.indexOf("MSIE") > 0;
MzBrowser.mozilla = window.navigator.product == "Gecko";
MzBrowser.netscape = window.navigator.vendor == "Netscape";
MzBrowser.safari = ua.indexOf("Safari") > - 1;
if(MzBrowser.firefox) var re = /Firefox(\s|\/)(\d+(\.\d+)?)/;
else if(MzBrowser.ie) var re = /MSIE( )(\d+(\.\d+)?)/;
else if(MzBrowser.opera) var re = /Opera(\s|\/)(\d+(\.\d+)?)/;
else if(MzBrowser.netscape) var re = /Netscape(\s|\/)(\d+(\.\d+)?)/;
else if(MzBrowser.safari) var re = /Version(\/)(\d+(\.\d+)?)/;
else if(MzBrowser.mozilla) var re = /rv(\:)(\d+(\.\d+)?)/;
if("undefined" != typeof(re) && re.test(ua))
MzBrowser.version = parseFloat(RegExp.$2);
}
)();
function upLoadKey(e, object)
{
if((document.all) ? true : false)
{
window.event.keyCode == 9 ? (window.event.returnValue = true) : (window.event.returnValue = false);
}
else
{
if(object.value == "" && typeof e.which == "number")e.preventDefault();
if(object.value != "") object.blur();
}
}
function version(object)
{
if(MzBrowser.firefox && MzBrowser.version == 2)object.blur();
}
function clearValue(id)
{
var up = (typeof id == "string") ? document.getElementById(id) : id;
if (typeof up != "object") return null;
var tt = document.createElement("span");
tt.id = "__tt__";
up.parentNode.insertBefore(tt, up);
var tf = document.createElement("form");
tf.appendChild(up);
document.getElementsByTagName("body")[0].appendChild(tf);
tf.reset();
tt.parentNode.insertBefore(up, tt);
tt.parentNode.removeChild(tt);
tt = null;
tf.parentNode.removeChild(tf);
}
// 页面代码
复制代码 代码如下:
<html>
<head>
<script language="javascript" src="/UploadFiles/2021-04-02/upLoad.js"></head>
<body>
<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');"/>
</body>
</html>
window["MzBrowser"] ={};
(function()
{
if(MzBrowser.platform) return;
var ua = window.navigator.userAgent;
MzBrowser.platform = window.navigator.platform;
MzBrowser.firefox = ua.indexOf("Firefox") > 0;
MzBrowser.opera = typeof(window.opera) == "object";
MzBrowser.ie = ! MzBrowser.opera && ua.indexOf("MSIE") > 0;
MzBrowser.mozilla = window.navigator.product == "Gecko";
MzBrowser.netscape = window.navigator.vendor == "Netscape";
MzBrowser.safari = ua.indexOf("Safari") > - 1;
if(MzBrowser.firefox) var re = /Firefox(\s|\/)(\d+(\.\d+)?)/;
else if(MzBrowser.ie) var re = /MSIE( )(\d+(\.\d+)?)/;
else if(MzBrowser.opera) var re = /Opera(\s|\/)(\d+(\.\d+)?)/;
else if(MzBrowser.netscape) var re = /Netscape(\s|\/)(\d+(\.\d+)?)/;
else if(MzBrowser.safari) var re = /Version(\/)(\d+(\.\d+)?)/;
else if(MzBrowser.mozilla) var re = /rv(\:)(\d+(\.\d+)?)/;
if("undefined" != typeof(re) && re.test(ua))
MzBrowser.version = parseFloat(RegExp.$2);
}
)();
function upLoadKey(e, object)
{
if((document.all) ? true : false)
{
window.event.keyCode == 9 ? (window.event.returnValue = true) : (window.event.returnValue = false);
}
else
{
if(object.value == "" && typeof e.which == "number")e.preventDefault();
if(object.value != "") object.blur();
}
}
function version(object)
{
if(MzBrowser.firefox && MzBrowser.version == 2)object.blur();
}
function clearValue(id)
{
var up = (typeof id == "string") ? document.getElementById(id) : id;
if (typeof up != "object") return null;
var tt = document.createElement("span");
tt.id = "__tt__";
up.parentNode.insertBefore(tt, up);
var tf = document.createElement("form");
tf.appendChild(up);
document.getElementsByTagName("body")[0].appendChild(tf);
tf.reset();
tt.parentNode.insertBefore(up, tt);
tt.parentNode.removeChild(tt);
tt = null;
tf.parentNode.removeChild(tf);
}
// 页面代码
复制代码 代码如下:
<html>
<head>
<script language="javascript" src="/UploadFiles/2021-04-02/upLoad.js"></head>
<body>
<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');"/>
</body>
</html>
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“javascript 限制输入和粘贴(IE,firefox测试通过)”评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。