jscript

Error adding SCRIPTITEM_CODEONLY symbol using IE9 JS engine (Chakra)

回眸只為那壹抹淺笑 提交于 2019-12-06 17:48:25
We've been using active scripting in our browser extension (BHO) for a while with the old JScript engine (CLSID_JScript), and we recently decided to support the new IE9 script engine (Chakra) as well. One thing we do is add symbols to the engine using AddNamedItem with the SCRIPTITEM_CODEONLY option to create our own modules (namespaces). Unfortunately, we haven't been able to get this to work with Chakra. Even the most trivial example where we add a symbol and immediately retrieve its script dispatch yields an E_OUTOFMEMORY error. if (SUCCEEDED(hr)) { hr = scriptEngine->AddNamedItem(L"test",

Windows update downloader.Download() fail

拟墨画扇 提交于 2019-12-06 14:55:49
I come across a sample vbscript program from Microsoft site regarding Windows Update(named WUA_SearchDownloadInstall.vbs). http://msdn.microsoft.com/en-us/library/aa387102%28VS.85%29.aspx Set updateSession = CreateObject("Microsoft.Update.Session") Set updateSearcher = updateSession.CreateupdateSearcher() WScript.Echo "Searching for updates..." & vbCRLF Set searchResult = _ updateSearcher.Search("IsInstalled=0 and Type='Software'") WScript.Echo "List of applicable items on the machine:" For I = 0 To searchResult.Updates.Count-1 Set update = searchResult.Updates.Item(I) WScript.Echo I + 1 & ">

Get command line arguments with jscript.net

浪尽此生 提交于 2019-12-06 14:38:09
问题 None of these work: var arguments = System.Environment.GetCommandLineArgs(); ~ var arguments = Environment.GetCommandLineArgs(); ~ var arguments:String[] = System.Environment.GetCommandLineArgs(); ~ var arguments:String[] = Environment.GetCommandLineArgs(); it prints JS1135: Variable 'System' has not been declared or error JS1135: Variable 'Environment' has not been declared . Even in MSDN there's no example with jscript. Is is possible to get the arguments in jscript.net ? 回答1: This works:

input field validation does not work under internet explorer 11 why

空扰寡人 提交于 2019-12-06 13:34:30
Unable to get the following code to do field validation for email and to accept only certain emails input as per my code..this code works in all browsers accept Internet explorer 11, how can adopt this code to work under I.E 11 to only accept from certain email format addresses... under I.E. 11 - it checks for empty field ok but i can not get the email pattern to work (html5) how can i get it to work under IE 11, it works on other browsers okay, thanks in advance...singhy <?php if(isset($_POST["Subscribe"])){ //name of submit button foreach($_POST as $fieldName => $value){ if($fieldName!=

Writing ECMAScript5 compliant code

泪湿孤枕 提交于 2019-12-06 11:01:16
I want to build a library in JavaScript/JScript/ECMAScript...whatever you want to call it, which will target modern standards (HTML5, CSS3, ESv5) with that in mind, any browser that supports the standard! Now I know there are already plenty of useful libraries out there, i.e. jQuery and MooTools. Of course they're great and I already use those where necessary, but I should not be forced to jump on the same bandwagon as every other developer just because it's popular! So for the sake of the following questions, let us not concern ourselves with 3rd party libraries such as jQuery and MooTools.

Unzip a file with batch & Jscript hybrid using common variables

时间秒杀一切 提交于 2019-12-06 09:46:08
This thread shows the batch & VBS hybrid code used to unzip a ZIP archive file. Can a similar short batch & Jscript hybrid code be written, and how batch variables will be referenced in the Jscript block? Would the similar batch & wsf hybrid structure be applicable like in the referenced thread, or a different approach? <!-- : Begin batch script @echo off set "dir=%TEMP%\Unzip" & set "file=%USERPROFILE%\Downloads\archive.zip\" cscript //nologo "%~f0?.wsf" "%dir%" "%file%" exit /b ----- Begin wsf script ---> <job><script language="JScript"> 来源: https://stackoverflow.com/questions/38612727/unzip

Is there any practical use of redefining Math.constructor in JavaScript/ActionScript?

╄→尐↘猪︶ㄣ 提交于 2019-12-06 09:06:22
问题 The Math object does not have a prototype property, but does have a constructor property. Is there any case in which redefining the constructor would be useful? 回答1: MDN says: Unlike the other global objects, Math is not a constructor. All properties and methods of Math are static . In other languages, when a class is static, you can directly use its properties and methods without creating an instance of that class ( an object ). If Math constructor is used, there is no native type to support

Show loading gif while waiting for ajax response

老子叫甜甜 提交于 2019-12-06 08:17:12
问题 I have a seat chart. When i click a seat, i want to show a loading gif. Seat chart comes from svg document. Seats are svg elements. When ajax response returned, i want to hide loading gif. I wrote code below but it doesnt work. <section> <div class="parent" style="text-align: center;"> <div class="panzoom" style="width: 500px; height:375px;"> <div class="loading" style="display:none" id="loading"><img src="../../Scripts/spinner.jpg" style="width:200px; padding-left:175px;"/></div> </div> <

Property Bag in javascript

淺唱寂寞╮ 提交于 2019-12-06 00:40:32
I'm investigating some code outside my scope that's written in a style I've never seen before. I'm trying to understand the inner workings of the following property bag: Setter: props.Property(name) = val; Getter: val = props.Property(name); What would you need to instantiate for the setter to function as above? EDIT: Less simplification, this code IS successfully running on a BrowserWindow within a frame (similar to a phone environment). var UI = { ready: function(oProps) { try { if (oProps) { window.external.Property(UI.FrameWidth) = '1000'; window.external.Property(UI.FrameHeight) = '900';

Is there any reason to replace JavaScript with JScript in Internet Expolorer?

时间秒杀一切 提交于 2019-12-05 21:16:53
So when JScript is different from JavaScript, how does IE interpret jQuery, and all the other JavaScript-s ? Is it better to replace the JavaScript with JScript for IE? Are there any performance diferences? JScript and JavaScript are the same. They're just aliases for each other: (via Wikipedia ) As explained by JavaScript guru Douglas Crockford in his talk entitled The JavaScript Programming Language on YUI Theater, "[Microsoft] did not want to deal with Sun about the trademark issue, and so they called their implementation JScript. A lot of people think that JScript and JavaScript are