GUI apps in javascript without a browser?

前端 未结 9 1779
眼角桃花
眼角桃花 2021-02-14 10:55

I would like to use javascript to develop general-purpose GUI applications. Initially these are to run on Windows, but I would like them to ultimately be cross-platform.

9条回答
  •  醉话见心
    2021-02-14 11:14

    Well, if you didn't want your software to be cross-platform, then you had two options on Windows:

    • HTML Application (HTA) .hta (tutorial)
    • Windows Script/Scripting Host (WSH) and the XML like Windows Script File (WSF) .wsf format, to mix JScript and VBScript and run them with cscript.exe/wscript.exe (example)

    Notes:

    • Option one actually uses Internet Explorer and mshta.exe under the hood, so I don't think it suffices your requirements.
    • Option two, JScript doesn't have all the VBScript GUI functionalities. So in the example provided above, you have to actually define VBScript SUBs to get GUI elements.
    • Microsoft's JScript and mainstream dialects of JavaScripts are not fully compatible.

    P.S. A great tutorial about WSH, WSF, VBScript, JScript ... here

提交回复
热议问题