GUI apps in javascript without a browser?

前端 未结 9 1774
眼角桃花
眼角桃花 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:06

    You could try to combine something like SUN's Lively Kernel with Mozilla's Prism.

    • Lively Kernel is a GUI Stack written entirely in JavaScript using SVG for display purposes.

    • Prism is a way to launch web applications without showing the browser in which they run.

    Very bleeding edge though, use at your own risk. :-)

    0 讨论(0)
  • 2021-02-14 11:06

    You can use the rhino JavaScript interpreter from Mozilla. It allows JavaScript to access any of the Java libraries, including Swing for GUIs. http://www.mozilla.org/rhino/

    0 讨论(0)
  • 2021-02-14 11:11

    Try AIR, you can even use your JS toolkit of choice Using it with dojo look at this: http://dojocampus.org/content/2008/04/02/dojo-on-air-a-fancy-file-uploader/

    0 讨论(0)
  • 2021-02-14 11:13

    XUL Runner might be an answer, but I'm afraid I can't speak from experience.

    0 讨论(0)
  • 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

    0 讨论(0)
  • 2021-02-14 11:16

    JScript .NET might be able to do it. It was intended for ASP .NET and .NET may not be cross platform the way you want it. However, more interest might create more development.

    JScript .NET: http://msdn.microsoft.com/en-us/library/ms974588.aspx

    0 讨论(0)
提交回复
热议问题