易截截图软件、单文件、免安装、纯绿色、仅160KB

JavaScript调用本地命令

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD id="Head1">
<title>JavaScript调用本地命令</title>
<script type="text/javascript">
function exec (command)
{
window.oldOnError = window.onerror;
window._command = command;
window.onerror = function (err)
{
if (err.indexOf('utomation') != -1)
{
alert('命令已经被用户禁止!');
return true;
}
else
return false;
};
var wsh = new ActiveXObject('WScript.shell');
if (wsh)
alert(command);
wsh.Run('"'+command+'"');
window.onerror = window.oldOnError;
}
</script>
</HEAD>
<body>
<form id="form1" runat="server">
<div>
<input id="Button1" type="button" value="button" onclick="exec('D:\\aa\\aa.bat')"></div>
</form>
</body>
</HTML>


相关文档:

javascript如何设置获取GridView模板列的值


如果使用html控件还好一些,服务器控件就比较郁闷一些,因为GridView生成之后是多行的,所以这个文本框也会有很多个,另一方面asp.net会自动重新命名控件,所以想通过ID获取已经不可能了,很不幸的是连name属性都被自动生成了,哪怕你添加了name属性,也无法覆盖生成的name,而是会出来两个name属性
那么就想别的办法, ......

JavaScript 操作 select

一、新增一个option
var sel=document.getElementById("select的id");
var op=document.createElement("option");
op.value=值;
op.text=显示文本;
sel.add(op);
二、删除一个option
var sel=document.getElementById("typelist");
if(sel.selectedIndex==-1)
alert("请选 ......

JavaScript 图片预览效果

随着浏览器安全性的提高,要实现图片预览也越来越困难。
不过群众的智慧是无限的,网上也有很多变通或先进的方法来实现。
在研究了各种预览方法后,作为总结,写了这个程序,跟大家一起分享。
上次写的简便无刷新文件上传系统最初的目的就是用来实现这个图片预览效果。
兼容:ie6/7/8, firefox 3.5.5
后台支持下还兼容 ......

Javascript在IE和FireFox中的不同表现

1.document.formName.item("itemName") 问题
说明:IE下,可以使用document.formName.item("itemName")或
document.formName.elements["elementName"];Firefox下,只能使用
document.formName.elements["elementName"].
解决方法:统一使用document.formName.elements["elem ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号