本文要点:
- 示例WScript.CreateObject的事件前缀绑定事件处理过程
- 示例InternetExplorer.Application在JScript下来模仿inputBox函数
- 示例JScript脚本宿主运行时访问页面内容、脚本的方法。
估计这文章一发表就注定被转抄的命运了,标记一下源地址:http://blog.csdn.net/winsenjiansbomber/article/details/41338243
/* Tips: an alert emulator for Wscript host */
function alert(msg){
WScript.Echo(msg+"");
}
// Binding event handler prefix: ONIE_
var IE = WScript.CreateObject("InternetExplorer.Application","ONIE_");
IE.left=50;
IE.top = 100;
IE.height = 200;
IE.width = 350;
IE.menubar = false;
IE.toolbar = false;
IE.statusbar = false;
IE.resizable = false;
IE.navigate("c:\\temp\\readme.html");
IE.visible = true;
while(!IE.Document.Script.GetValue){ // break when page load and run
WScript.Sleep( 300 );
}
alert("