Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building Standalone Applications in JavaScript

Tags:

With the increased power of JavaScript frameworks like YUI, JQuery, and Prototype, and debugging tools like Firebug, doing an application entirely in browser-side JavaScript looks like a great way to make simple applications like puzzle games and specialized calculators.

Is there any downside to this other than exposing your source code? How should you handle data storage for this kind of program?

Edit: yes, Gears and cookies can be used for local storage, but you can't easily get access to files and other objects the user already has around. You also can't save data to a file for a user without having them invoke some browser feature like printing to PDF or saving page as a file.

like image 493
Ben Combee Avatar asked Aug 18 '08 19:08

Ben Combee


People also ask

Can JavaScript create standalone applications?

If you want to write a standalone JavaScript application, look at XULrunner. It's what Firefox is built on, but it is also built so that you can distribute it as an application runtime. You will write some of the interface in JavaScript and use JavaScript for your code.

Can you build applications with JavaScript?

That's where JavaScript, specifically React Native, comes in. This JS-based tool lets developers build cross-platform mobile apps, instead of needing to code two completely separate apps. In fact, you'll probably recognize some of the apps that use it, like Discord, Microsoft Outlook, Facebook, and Instagram.

Can JavaScript standalone?

JSDB - A standalone JavaScript shell, with compiled binaries for Windows, Mac, and Linux. JavaLikeScript - A standalone, extensible JavaScript shell including both native and JavaScript libraries. GLUEscript - A standalone JavaScript shell for writing cross-platform JavaScript applications.

Is JavaScript good for desktop application?

JavaScriptIt is among the top programming languages for desktop app development. Using frameworks like Buildfire. js, Electron, NW. js, AppJS, Meteor, and Proton Natives, JS can help developers in designing and developing cross-platform desktop applications.


2 Answers

I've written several application in JS including a spreadsheet.

Upside:

  • great language
  • short code-run-review cycle
  • DOM manipulation is great for UI design
  • clients on every computer (and phone)

Downside:

  • differences between browsers (especially IE)
  • code base scalability (with no intrinsic support for namespaces and classes)
  • no good debuggers (especially, again, for IE)
  • performance (even though great progress has been made with FireFox and Safari)
  • You need to write some server code as well.

Bottom line: Go for it. I did.

like image 190
Avner Avatar answered Sep 24 '22 00:09

Avner


Another option for developing simple desktop like applications or games in JavaScript is Adobe AIR. You can build your app code in either HTML + JavaScript or using Flash/Flex or a combination of both. It has the advantage of being cross-platform (actually cross-platform, Linux, OS X, and Windows. Not just Windows and OS X).

Heck, it may be the only time in your career as a developer that you can write a web page and ONLY target ONE browser.

like image 22
ScottKoon Avatar answered Sep 25 '22 00:09

ScottKoon