Key points of this article: example WScript. CreateObject event prefix binding event processing example InternetExplorer. Application in JScript, it imitates the inputBox function example JScript host's method of accessing the page content and script during runtime. It is estimated that this article is doomed to be copied as soon as it is published, marking the source address: * Tips: ana
Key points of this article:
- Event prefix binding process for example WScript. CreateObject
- Example: InternetExplorer. Application imitates the inputBox function in JScript
- Example: how to access the page content and script when the JScript host is running.
It is estimated that this article is destined to be the fate of the copy, marking the source address: 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("Please click OK");//alert(IE.Document.Script);//alert(IE.Document.body);//alert(IE.Document.Script.GetValue);alert("GetValue()="+IE.Document.Script.GetValue());WScript.DisconnectObject( IE );IE.Quit()alert("Disconnected");function ONIE_WindowStateChanged(state){ alert("Event: Window State Changed to "+state);}// Raised from loading a document in Internet Explorerfunction ONIE_DownloadBegin(){ alert("Event: Download begins");}/* Raised from quitting Internet Explorer, but we're * disconnecting from the object before calling * the Quit method to terminate Internet Explorer, so * the dialog box isn't shown. */function ONIE_OnQuit(){ alert("Event: Quit Internet Explorer");}
Readme.html:
Test Enter: