1

I have a business requirement for a javascript "write once run everywhere" App. I did research and discovered that there are a few options between: FireFox OS, ChromeOS, NodeOS, Tizen, and Dart.

What I do not know - is if 1) this software is truly capable of allowing a single website to be written once and exported to Hosted or Packaged Native Apps.

2) Can a single JavaScript Website really traverse device-platform as a Native App via this breed of JavaScript Operating System or not?

3) Is it simple, or is it painful? Has anyone seen a full implementation first hand in at least a test environment or production?

Also - are the upsides expected or unexpected - and what are the downsides?

Overall: is JavaScript write once run everywhere - or not?

To the point it isn't 'Native' - I found these.

Apple iOS7 JS first-class citizenship. Last month. http://fluentconf.com/fluent2014/public/schedule/detail/32624 It is called JavaScriptCore framework.

I installed a FireFox OS Open WebApp with emulator. https://developer.mozilla.org/en-US/Apps/Quickstart/Build/Your_first_app

I don't know what these are, but it was easy and it looks cool. Like a website packaged into a Native App.

Has any one reviewed this class of JavaScript Architecture?

  • 2
    Not native apps. Native apps use the native programming language: Objective C on iPhones and iPads, Java on Android devices. Javascript runs everywhere because all of these devices have a browser. The usual browser incompatibility issues apply, although I think browsers are getting much better in that respect. – Robert Harvey Jan 16 '14 at 0:08
  • JavaScript it's self is not, however web applications are probably as close too “write once run everywhere” as you can get. Anything that runs in the browser is going to run on any modern browser in almost identical manors as that is the intended nature. Some comparability issues arise, but they are generally easy to work around. Basically, if an app is just a file full of JS, HTML, and resources; and intended to be run in-browser, then it should "run everywhere". – zeel Jan 16 '14 at 4:15
  • More like "Write once, debug everywhere" – SomeKittens Jan 17 '14 at 1:43
2

A huge part of a JaveScript program has to do with the DOM (the objects that JavaScript works on, e.g. typically all of the stuff that shows up on your screen), and that is not actually part of JavaScript but ties a given JavaScript code to it's DOM.

So for example, the JavaScript on FireFox and IE might be similar or even identical, but differences in the DOM mean that the two implementations don't work quite the same when actually run.

It's sort of the idea of the program and the data. They are intertwined. JavaScript is code. DOM is data (in simple terms).

JScript is useful in that it provides an abstraction layer so that things work the same everywhere.

  • Isn't JavaScript independent of the DOM? – Jack Stone Jan 17 '14 at 1:42
  • 1
    @ClintNash: Fully. See projects like Node.js for proof of that. However, a "javascript app" is going to use HTML as its frontend, which means you'll be interacting with the DOM at some point. – Phoshi Jan 17 '14 at 13:31
  • @ClintNath, yes and no depending on how you look at it, just as MySQL is intellectually independent of it's data, but in a given specific coupling it is closely bound to it. I need to give you a good example of IE vs FireFox DOM so you can see. In ajax how you get the XML object is different between IE and the rest of the world, and it's because IE's DOM is different. Here is the core javascript code: ajax = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP"); – Elliptical view Jan 18 '14 at 5:46
1

No more than any other language. There are plenty of inconsistencies between JavaScript engines - in fact, that's why most JavaScript frameworks, including jQuery, get started - trying to smooth those differences over. And that's before you get into platform-specific aspects. For example, Palm OS phones used JavaScript as their primary app language. But the components your code interacted with were highly-Palm OS-specific, so they wouldn't be able to move to Android or iOS.

  • Interesting, Palm OS - isn't that Web OS in LG TVs now... – Jack Stone Jan 17 '14 at 1:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.