How to build a desktop like application interface using JavaScript?

You would use input fields and have a separate button elsewhere to recalcuate the fields.

I call false on this one. Web pages are not desktop applications, so they should not be expected to work as such without the involvement of scripting.

For a web page to work as a desktop application, that requires scripting to fill in the differences between a web page and a desktop application.

I suggest this is the crux of the matter.

A web page is not a desktop application. Nor is a web PAGE a web APPLICATION.

A web application is a replica of desktop application. It’s whole intention is to be used in the same way as a desktop application. The only difference is that it is accessed via a web browser rather than a desktop GUI.

And since Excel doesn’t require JavaScript to be enabled for it to work the web equivalent shouldn’t require JavaScript either. In both cases there is a programming language available to do the processing that is outside the control of the person using the application.

JavaScript is always under the browser owner’s control. If I decide that for any JavaScript running in my browser that 2+2=5 then I can set up JavaScript to run in my browser that overrides any attempt by a web page JavaScript to calculate any other answer and replace it with the answer of my choice. Or I can simply stop any JavaScript running on specific web pages after the page finishes loading automatically using JavaScript. Or anything else I want JavaScript to do in my browser since the browser owner has full control of the JavaScript that runs in their browser and can run whatever JavaScript they want to override any in the web page itself.

With JavaScript saying that 2+2=5 you still need the server side processing that you’d need without JavaScript in order to override the answer with the one your application needs.

As I already mentioned somewhere earlier in this thread Google has added crap JavaScripts to some of their pages that do not function correctly in my browser so I instructed my browser to not run that garbage. If any other sites cause me problems I’ll just use JavaScript to turn off the scripts on those sites too. So the site needs to have the right server side code so it works when the site stupidly gets people who don’t have a clue about JavaScript to write garbage on the front end of the site that you have to turn off to be able to use the site at all.

We must actually be careful when using JavaScript for maths. As any old-hand knows, with JavaScript, 0.1 + 0.2 does not equal 0.3

See: Why I Love ECMAScript 4: Real Decimals

Your red herring that Excel doesn’t require JavaScript to be enabled for it to work deliberately tries to avoid the actual point. The point is, if someone wishes to create a browser based interface to a web based spreadsheet application and wishes that interface to perform in a way that is familiar to someone who is used to a desktop based spreadsheet application, that interface must, of necessity, incorporate JavaScript.

Exactly! JavaScript is not the application. JavaScript provides the interface to the application. The JavaScript enables interface behaviors intended to create the impression that one is using the web based spreadsheet in exactly the same way as one would use the desktop based spreadsheet.

Regardless of your strawman argument regarding the quality of Google’s JavaScript, the Google spreadsheet is intended to imitate the interface of a desktop spreadsheet such as Excel. Whether Google achieve this may be debatable, but what is not debatable is that the behavior of a desktop spreadsheet could not be reproduced in a browser without JavaScript enabled.

Now I may be misunderstanding you. Perhaps you are simply contending that an interface such as the one I describe is all well and good, but the application should also be able to be operated without JavaScript enabled.

I must confess to not being an expert on the finer points of computer usage by those with disabilities nor the latest assistive technologies, so I am interested to know the kinds of disabilities which would prevent someone using a JavaScript enabled browser to access a web based spreadsheet application, but not prevent them from using something like Excel.

You can try it yourself. Close your eyes and try to use an application spreadsheet. Do you find it too difficult? Turn on the assistive technology that Windows comes with. Even with those you may find it quite hard. That’s only vision. There are a whole range of vision related issues from poor eyesight through to different types of color blindness.

Then there is the hearing aspect of things. With applications this is not normally an issue, but it can be if you rely on sound alone to alert the user to a situation.

The specific situations that prevent someone from using a web-based spreadsheet as opposed to an application spreadsheet are that Microsoft provide much greater assistive technology with application-based software, as opposed to web-based software.

In relation to javascript, the assistive technology are often special browsers that do their best to help disabled users. The trouble is that javascript-based changes to the page are not picked up by those special browsers, and that those browsers typically cannot receive information from javascript (such as the current cell that you’re on).

Give it a go, experience it for yourself, and only then will you begin to understand the types of issues that people face. How many times do your eyes have to be opened?

Your red herring that Excel doesn’t require JavaScript to be enabled for it to work deliberately tries to avoid the actual point. The point is, if someone wishes to create a browser based interface to a web based spreadsheet application and wishes that interface to perform in a way that is familiar to someone who is used to a desktop based spreadsheet application, that interface must, of necessity, incorporate JavaScript.

John, what I think they are saying is, you can (and should) build any web applications as if the client only deals with HTML. This means lots of communication with the server, so that the back end scripting language (not Javascript which relies on the client, but Perl, PHP, Ruby, Java, Python, whatever is running on YOUR server) does all the work.

Then add a layer of JS sugar on top, like AJAX to reduce calls to the server. You can say, IF the client supports Javascript, then let Javascript take over some of the tasks the back-end language has to do… that way, if they Don’t have Javascript, it means the back end script has to do all the heavy lifting, but since many clients will run Javascript, Javascript will (for those people) be doing a lot of the work.

So, you don’t NEED Javascript but the main issue is, it’s a Bad Idea to rely on the client, unless of course you are building some internal application for some business/party to whom you can dictate that they have capability X.

Relying on the client to have application x, scripting x, image rendering x… is not generally a good idea with general web pages or general web applications because there are plenty of clients who don’t have those things.

Now if your website is called YouTube and your purpose for existing is to Play Flash Videos then, yeah, guess what they may demand of their visitors? However they still did it mostly ok: I can go to YouTube without Flash or Javascript and I can search for videos, read comments, log in… I’ve seen too many sites that required Javascript for simple things like reading comments, posting comments, clicking hyperlinks (way to go, let’s imitate HTML behaviour with a layer of scripting for the lawlz!), or logging in or even searching.
Of course, they goofed after Google got ahold of them: you now log in via Google and while I can log in, I can’t log out. " Let’s put an anchor with no href in there and disguise it as a submit" for the lawlz.


<a href="#" onclick="document.logoutForm.submit(); return false;">Sign Out</a>

In web design, this is considered Bad Coding. It does not degrade, it dies a horrid death. It’s Made of FAIL. What’s the point of even having return false? False what, it’s not like there’s actually an href in there anyway… oooh, they stopped a page refresh. Bleh.

Here’s another example of Javascript Done Wrong: http://perldoc.perl.org/
Unless he’s fixed it, you cannot use simple search form to search without Javascript.

Well, usually it’s a normal graphical browser with AT tacked on top.

The good news is, the newer versions of the popular readers are doing better at updating the virtual buffer, and better at letting the user know that the vb has been updated due to an action they’ve done (or due to anything imitating a refresh). It seems up to 70+% of screen reader users (from one webAIM survey which certainly only reaches a certain demographic) has JS on, but also have trouble with it.

The bad news is, AT is expensive and lots of people are still stuck with JAWS6 (which means they’re also stuck with IE6) or Windows-Eyes 5 or whatever. The free ones are more likely to be updated (NVDA, orca) but they don’t seem to be as popular as the commercial readers yet. So we must assume that screen reader users might also have JS on, that JS might not work very well with them, and realise things are even worse for us developers… or, that we just need to have a high level of code we consider “quality” meaning that it’s well written at every level for all sorts of UAs.

Some interesting links, not all are recent:
http://www.456bereastreet.com/archive/200612/you_cannot_rely_on_javascript_being_available_period/

http://northtemple.com/2008/10/07/javascript-and-screen-readers

http://webaim.org/projects/screenreadersurvey2/

With around 5-10% of people having JavaScript turned off or not available to them at all your web pages must be capable of working without JavaScript.

The correct way to add JavaScript to any web page is to test the page first to make sure that it is fully functional without JavaScript and to then add the JavaScript that makes the page easier to use for those who have it.

JavaScript is misused on so many sites that a lot of experienced web users have it turned off just because they got fed up of all the misuse.

While the operation of the page for those without JavaScript may involve five or ten or even twenty times as many steps to achieve the same result as with JavaScript enabled the fact that it still works without JavaScript means that everyone can use the page. If the page is broken without JavaScript then you have at least 5% of people who visit your page telling everyone that your page is broken so don’t bother visiting it. Those people without visiting your site will then tell their friends the same and so on and before you know it somewhere between 20 and 95% of your potential visitors are avoiding your broken site.

looks like most of people voting for jQuery, while I think it’s not the best choice for desktop-like interfaces, since it does not have enough libraries built-in for advance interfaces.
I voted for extJS, wasn’t using it much, but it looks like it better choice for than jQuery.

Do you have any example of this happening with any major web-site/application?
While it’s possible in theory, many major websites use website for more than just “nice features”.

I have yet to find a major web site that breaks when you turn off JavaScript.

There are a few that break with JavaScript enabled though which is one of the reasons why so many people turn JavaScript off completely. Not everyone knows how to disable JavaScript on a site by site basis.

What about web-applications?
For example, Google Docs does not work with JavaScript turned off.

I actually have yet to find site that breaks because of javascript in major browser, could you give some examples?

Just about everything produced by Google - since it appears that Google don’t employ anyone who knows how to write JavaScript and so all the JavaScript attached to Google pages is garbage and breaks as soon as you use anything slightly out of the ordinary in YOUR configuration of YOUR browser.

I have found that the only way to be able to efficiently use any Google web site is to first disable JavaScript for that site.

For example with JavaScript enabled Google search will not allow me to return to the search results - any attempt to do so redirects back to the garbage page that I just decided wasn’t what I was looking for.

As another example, the GMail script pops up all sorts of alerts about my browser not being supported if I try to access it with JavaScript enabled - particularly if I try to access it using IE8 or Firefox 3.5. Only by turning JavaScript off can I get GMail to actually let me use it.

Fortunately all the Google sites I consider to be worth using do work with JavaScript turned off even though they break easily with it enabled.

You’re right about Google Docs - that site is broken both with and without JavaScript enabled and so is totally unusable to anyone who doesn’t have their browser configured the way the idiots who coded the site expect.

Not sure what you mean by slightly out of the ordinary, but services that use from google never break in my configuration. In addition, I don’t think it’s right to expect it work whatever happens. You will not drive F1 car on rally road and expect it to stay in one piece, because it was not designed to do so.

Works for me in FF2,3,3.5, and IE6,7,8, Safari and Opera.

So, the main question what is your out of the ordinary configuration that does not allow common javascript code to work?

I surf everywhere without Javascript on and while I don’t use google for anything but search and (rarely) mail, both of those work fine with JS off. The only benefit to turning JS on for Google is that the focus is brought automatically to the main search bar, which, frankly, I would have put that first and have the rest of the menu (maps, images, blah blah) come later in source, but that’s me. So I have to tab, big whoop.

Since I don’t use JS with Google I can’t say I’ve ever had the redirect problem (in fact, I know that my testing browsers in VirtualBox who all have JS on use the back button with ease) but Google’s JS isn’t known for being great. Mostly, it seems to work “ok” but unlike Amazon they don’t seem to think about degradability as much… logging into and out of YouTube being a good example. I can log in fine. I can’t log out. The owned-by-google logout is very poorly written, and they should fix it.

Amazon allows me to order products without Javascript enabled (I’ve ordered with Lynx and I’ve ordered in IE with JAWS), and I add things to my cart and use the back button frequently. They must have a pretty complicated server-side session going on. I don’t block cookies but without Javascript enabled I couldn’t use any JS cookies. While their HTML is terrible, Amazon’s site is built very very well: there’s a lot of graceful degradation, lots of ways to do something, a hidden skip link offers a more text-friendly version of the site if you want, and there’s a simple site for mobiles if you want that too. I like how any menu that have javascript for the expanding menus (which I only just discovered the other day in my Chrome browser which I cannot turn JS off) are simply “open” by default and completely usable. I’d say they’re a pretty good example of how a large, commercial, complicated site can work and do all sorts of clever things whether you have scripts on or not, css on or not, whatever.

That said, they are a commercial shopping site and not a desktop application. However they use refreshes and more communication with the server when you have no JS as Felgall suggests should be used by any Web Site that is geared to the General Public rather than to some specific demographic where you can more easily demand certain things. And even then…

Start chrome with the -disable-javascript parameter (edit the shortcut to make it permanent) and you’ll be set.

Start chrome with the -disable-javascript parameter (edit the shortcut to make it permanent) and you’ll be set.

I’m not sure how to do that with Ubuntu. I don’t start Chrome from the terminal. However, your comment made me figure there’s prolly a man page for it now : )

*edit well silly man page doesn’t mention any chrome-specific flags but
$ google-chrome --disable-javascript in the terminal works nice! Thank yous.

I really don’t understand what is the reason to surf with JavaScript turn off completely in browser. It’s not the 20th century anymore. Without JavaScript you’re loosing too much functionality on websites (not mentioning web apps).
Of course, it “does work” without JavaScript, but it’s not productive. Yes, Google search works without js and you can focus search field manually by tab, but it’s just matter of productivity and convenience. One key here, one key there and it will a lot of time spend for nothing.

Some people have a different set of rules that they live by than yourself. That’s life, and as web designers we need to accommodate them or lose them.

Completely agree that as developers we should accommodate everybody, but it does not mean that we understand the intentions behind someone’s set of rules (which was my question).

In context of the topic, desktop-like applications do not go next to websites in terms of development techniques used, because they are just different. If you can state that website should work without js, I cannot imagine anybody would expect for example live support chat to work without js. There are just some apps that need new techniques or they will not work.