jscript

Classic ASP: how to convert a RecordSet to json notation using AXE json implementation

♀尐吖头ヾ 提交于 2019-11-28 10:10:57
问题 i'm doing an application with ajax using jQuery and some other tools, and in some part i want to retrieve data with ajax using a classic ASP backend, i saw that exists a good implementation of a JSON class in AXE (Asp extreme edition) framework, and i used it but currently i don't understand how to use it well. Edit : based on the correct answer of JSON.Stringify fails on Scripting.Dictionary objects Thread, i decided to make a custom function to process Recordsets. Edit 2: Now i'm losing the

Create COM/ActiveXObject in C#, use from JScript, with simple event

若如初见. 提交于 2019-11-28 10:06:19
I'd like to create a COM object in C#, and use it via IDispatch from JScript. That part is pretty simple. I also want to implement simple callbacks on the COM object, similar to the event exposed by the XmlHttpRequest object that is usable in a browser. That model allows Javascript to attach event handlers like this: var xmlhttp = new ActiveXObject("MSXML.XMLHTTP"); xmlhttp.onReadyStateChange = function() { ... }; I want my client-side JScript code to look like this: var myObject = new ActiveXObject("MyObject.ProgId"); myObject.onMyCustomEvent = function(..args here..) { ... }; What does the C

Parsing a JSON object array in Excel VBA

别来无恙 提交于 2019-11-28 08:45:46
I know a similar question has been asked and answered before a few times: Parsing JSON in Excel VBA , Excel VBA: Parsed JSON Object Loop However, the above solution doesn't work if I am trying to access an array within the returned object. I'm receiving a JSON object from the Google Translate API in the following format: "{ "sentences":[ { "trans":"Responsibility\n", "orig":"??", "translit":"", "src_translit":"Zérèn" }, { "trans":"Department", "orig":"??", "translit":"", "src_translit":"Bùmén" } ], "src":"zh-CN", "server_time":86 }" I want to be able to access the two translated sentences as

How to replace comma with a dot in the number (or any replacement) [duplicate]

自古美人都是妖i 提交于 2019-11-28 08:01:24
This question already has an answer here: Replace method doesn't work 4 answers I could not found a solution yet, for replacing , with a dot. var tt="88,9827"; tt.replace(/,/g, '.') alert(tt) //88,9827 i'm trying to replace a comma a dot thanks in advance As replace() creates/returns a new string rather than modifying the original ( tt ), you need to set the variable ( tt ) equal to the new string returned from the replace function. tt = tt.replace(/,/g, '.') JSFiddle You can also do it like this: var tt="88,9827"; tt=tt.replace(",", "."); alert(tt); working fiddle example After replacing the

How to close a HTA window from another HTA?

杀马特。学长 韩版系。学妹 提交于 2019-11-28 02:17:37
I've tried to implement my own modal dialogs ( Why? ). I open a new window using WScript.Shell : dlg = shell.Run(dlgPath, 1, true); The line above creates a "semi-modal" HTA window. The script execution is stopped at this line, but the main window is still responsive. This issue is tackled within onfocusin eventhandler, which returns focus back to the new HTA window using shell.AppActivate() . This prevents even "Close Window" button to close the main window. However, in Windows7 there's a back gate to close the main window, the icon in Windows Task Bar. If the main window is closed, a decent

What's the difference between JavaScript, JScript & ECMAScript? [closed]

╄→尐↘猪︶ㄣ 提交于 2019-11-27 10:48:03
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . OK, so I'm trying to learn JavaScript properly so that I can write good, clean client-side code, but whenever I think I'm making

Upgrading IIS/Classic ASP Javascript/JScript Scripting Engines (to Chakra?)

泪湿孤枕 提交于 2019-11-27 07:28:41
问题 Microsoft are quoted as saying that javascript is now a first class citizen in Visual Studio and the "Universal Windows platform" but I have yet to find a way of upgrading the decade+ old JScript engine used in IIS/Classic ASP script. So, my question is, does anyone know if there is a way to do this? Why? I'd like to use JSON.parse, for example, in a classic ASP page (that uses javascript not VBScript). Currently, I'm including a copy of Crockford's old json script which is okay but these

ActiveX event handlers in an HTA using Javascript

大兔子大兔子 提交于 2019-11-27 06:38:39
问题 In C# I can write event handlers as follows: var wdApp = new Microsoft.Office.Interop.Word.Application(); wdApp.DocumentBeforeSave += (Document doc, ref bool saveAsUI, ref bool cancel) => { //do stuff here }; In VBA/VB6, I can use static event handling: Dim WithEvents wdApp As Word.Application Private Sub wdApp_DocumentBeforeSave(ByVal Doc As Document, SaveAsUI As Boolean, Cancel As Boolean) 'do stuff here End Sub I would prefer to use dynamic event handling. However, in Javascript, even when

Copy folder contents to a created .zip file: 'file not found or no read permissions'

不羁岁月 提交于 2019-11-27 06:23:29
问题 I'm trying to create a .zip file from an existing folder using JScript and it seems that my copyHere function is not copying to the .zip folder. Instead I get a popup box titled 'Compressed (zipped) Folder Error' with the message 'file not found or no read permissions' even though I have read/write privileges on the file according to the value of my file.attributes property (32). Here is the script I'm using: //Get commman line arguments var objArgs = WScript.Arguments; var zipPath = objArgs

Create COM/ActiveXObject in C#, use from JScript, with simple event

坚强是说给别人听的谎言 提交于 2019-11-27 03:26:25
问题 I'd like to create a COM object in C#, and use it via IDispatch from JScript. That part is pretty simple. I also want to implement simple callbacks on the COM object, similar to the event exposed by the XmlHttpRequest object that is usable in a browser. That model allows Javascript to attach event handlers like this: var xmlhttp = new ActiveXObject("MSXML.XMLHTTP"); xmlhttp.onReadyStateChange = function() { ... }; I want my client-side JScript code to look like this: var myObject = new