How to build a desktop like application interface using JavaScript?

Thanks, to felgall, Alex and others, for the clear reminder about how many people are effected by these important issues.
I agree with the idea that “deaf people can’t hear music, this is an unfortunate part of the world we live in”, mentioned earlier.

  1. Some things can not be done without Javascript / Ajax.
  2. So people without disabilities should be denied the option of certain RIA’s in order to make certain (almost) every single person can use the site?

Is this how far the “accessibility requirements” movement has evolved?

That statement is completely false with respect to web applications.

Anything that can be done with JavaScript/Ajax can also be done using HTML forms and submit buttons. It may require a few extra steps and reloading the page for each step but if it can be done with JavaScript it can be done without JavaScript - at least as far as web applications are concerned (animations and similar within web pages can’t be done without JavaScript but they shouldn’t be essential to the page anyway).

In so far as web applications are concerned - if it can’t be done using forms without JavaScript then it can’t be done with JavaScript either since all the JavaScript can do is to remove the need for submit buttons and page reloads.

Actually, it’s not. Ever used TinyMCE, FCKEditor or any other on-the-fly WYSIWYG editor? There’s no point in even attempting such functionality without it. What about a stylesheet editor with dynamic preview?

If I thought about it for a few seconds, I’m sure I could come up with several more.

Of course JavaScript is what makes those things dynamic BUT the functionality can still be provided without being dynamic without needing the JavaScript.

So your WYSIWYG editor requires a page reload for each change for the result to show as does the stylesheet editor. The page reload is the price that those without JavaScript pay for not having JavaScript available to make it dynamic. They shouldn’t have to pay the price of not being able to use it at all just because they turn off the dynamic part.

Anyway with the way Google search is now using JavaScript I would expect the percentage of people with JavaScript disabled to grow rapidly. That search engine is now unusable with JavaScript enabled so turning off JavaScript is the only way to get search to work properly.Who cares if that loses a few dynamic functions elsewhere.

Your comparison is like my saying that you can get from here to there using a car, a train, or a plane and your reply being that you can’t get there if the plane’s wings are cut off.

Not necessarily, they might well just turn to another search engine, it could lead to Google loosing some market share of those who browse the Internet on the cell phones, and those who use Add-ons like No Script to block all scripts.

How is Google’s doing something to encourage the use of NoScript going to result in their losing market share amongst those already using it? It just means that more people will use NoScript in order to use Google.

The other search engines would need to double the pages in their results in order to even start to compete with Google. While the other search engines only list half as many pages (about 10%) as Google does (about 20%) there are lots of good reasons for using Google to perform searches even if it is necessary to turn off JavaScript to get the search engine to behave itself.

I just tested Google with Javascript disabled (via the web developer toolbar) it is prefectly usable and so there won’t be any affect at all on the number of people not blocking javascript.

Since the problem with Google is some recently implemented JavaScript that prevents your being able to return to the search results if the first link you chose wasn’t what you are looking for and the simplest fix is to turn JavaScript off so that you can get back to the search results of course it is usable with JavaScript off. It is only unusable with JavaScript on.

So more and more people will now be blocking JavaScript in order to fix Google.

No problems for me trying hitting back with both javascript enabled and disabled, perhaps you have a problem with your local setup

I haven’t changed anything but this wouldn’t be the first time Google have implemented JavaScript that doesn’t work properly in all browsers. Anyway I worked out a userscript fix that just strips all the JavaScript out of specific web sites and tested that it corrects the issue with Google.

// ==UserScript==
// @namespace     http://javascript.about.com
// @author        Stephen Chapman
// @name          Kill JavaScript
// @description   Strips all JavaScript from the web page
// @include       http://www.google.com/*
// ==/UserScript==

d=document;
while((el=d.getElementsByTagName('script')).length){
el[0].parentNode.removeChild(el[0]);
};
onerror=function(){};
d.close();

By installing the above as a userscript in Opera, Firefox (with Greasemonkey extension), or Internet Explorer 6+ (with IE7pro plugin) and replacing the @include with whatever web site you want (or repeating it for multiple sites) anyone using any one of those three browsers will be able to selectively strip all the JavaScript from specific web sites while still being able to have it enabled and running on all other sites.

Note that as with all userscripts this can’t affect any JavaScript that runs while the page is loading but this code will prevent any JavaScript running after the page finishes loading on whichever sites you list in the @include statements.

felgall, what browser (+version) are you using? I’m using FireFox version 3.5.6

Since the problem with Google is some recently implemented JavaScript that prevents your being able to return to the search results if the first link you chose wasn’t what you are looking for and the simplest fix is to turn JavaScript off so that you can get back to the search results of course it is usable with JavaScript off.

Wow, when did they start doing this?? and, WHY? Hitting the back button would, you’d think, be something Google wants. Assuming they measure how long it is between clicks from a single results page, they can better see which site are relavant/wanted based on the search terms someone typed in.

Any search engine, I do a lot of forward and back, likely because my google-fu is terrible… except on ixquick, which opens everything in a new tab for some reason… not sure if I like that or if it’s more handy.

Felgall, I suppose someone could also argue that an application with JS/AJAX could be reasonable to unleash unto the innerwebz but that if a significant number of users used thee same app without JS, that it would be a server load that would make the whole idea impractible. Or can that always be solved with clever Apache tricks or something?

I would go along with the Adobe air way of creating an application if you have limited scripting knowledge otherwise Flash works very well for this (and easy if using an app like swish to develop it.

Opera 10.10

The userscript I posted fixes the problem by completely deleting all the JavaScript from the Google web pages as soon as they finish loading. Obviously the people at Google haven’t written the JavaScript properly - they seem to produce huge of code that was considered to be a poor way of writing JavaScript way back in the 20th Century. I don’t think anyone at Google really knows the first thing about writing JavaScript properly or they wouldn’t have so many of their facilities where you need to turn JavaScript off in order for them to work properly (I had a similar problem before with GMail and Firefox).

felgall, i think you must have a local setup problem, GMail works fine for me with javascript enabled and I just tried google in Opera 10.10 (only downloaded and installed Opera 10.10 a few days ago) and it works fine for me. Are you using Windows? I’m using Windows Vista.

The GMail problem is that it uses a crappy browser sensing script. I was using Firefox at the time with a unique useragent to specifically identify me (I had IE set to use exactly the same useragent). Because the useragent wasn’t one that the crappy Google code expected the script totally malfunctioned. Such malfunctions are the fault of the script since useragent is allowed to be anything at all in IE and Firefox and can have several different values in other browsers.

In this latest situation I had been running Opera 10.10 for some time with Google functioning normally. Then the search engine suddenly started processing the links from the search result differently using a redirect so that when you try to return to the results page it automatically redirects back to the page you were just on. I hadn’t changed anything on my computer so the only possible cause for the change is in the JavaScript code that Google is using. Since Google tends to use JavaScript coding techniques that were obsolete ten years ago I have no reason to believe that the problem is anywhere other than their script and since deleting their JavaScript removes the problem I am even more inclined to believe that they have once again added some poorly written JavaScript to their site that tests for things that have no relevance whatever and then processes in weird ways depending on what they find. Even if it is something in my browser settings causing Google to behave the way that it is behaving the problem is in Google’s code and not in my settings since those settings should not be affecting that behaviour. What Google really need to do is to hire someone who knows how to write JavaScript rather than having their JavaScript written by people who haven’t the first clue as to how JavaScript works.

It really is such garbage scripts written by people who do not know the first thing about JavaScript that encourage more and more people to turn JavaScript off. For most people just turning it off completely gets rid of all the problems from garbage scripts. Some will use the toggle option in Opera or add the NoScript extension to Firefox (which provides the same functionality) in order to be able to easily turn it on and off as required. The userscript I posted will make it easier for anyone using Opera, Firefox, or IE to have JavaScript turned off automatically on selected sites where they have problems with the scripts rather than having to turn it off for everything.

My guess about the old out of date javascript is that they’re doing it to try and maintain compatibility with older web browsers. I don’t know why they are bothering with HTML5 when HTML5 isn’t finalised yet.

But even Netscape 2 supports feature sensing so the invalid browser sensing that they are doing was a poor way of supporting specific browsers even then and since all browsers earlier than that didn’t even support JavaScript there is no need to cater for them in the script at all.

If their script used feature sensing it would work in all browsers that support the required features but because it uses an extremely badly written browser sensing script it is trivial to get the script to crash in just about any browser just by changing the useragent. So the particular coding method that their script uses was obsolete back before Og the caveman was born. All it does is to prevent the script functioning in any browser where any one of a large range of legitimate configuration changes have been made in the browser. There is not one browser that their script supports that wouldn’t be better supported by feature sensing.

Effectively their script is doing the equivalent of testing for whether your car can go over a certain speed by checking if the car is red or grey in colour. If it is any other colour then the car is assumed to be missing a few wheels and so no attempt is made to get it to move.

There is no HTML 5 in their page so why are you wondering why they are bothering to use it when they are not using it. The doctype they are using is valid for all versions of HTML between 2 and 4.01.

Dmitri says it’s because they’re really Java programmers. So, verbosity and pedantics : )

The problem with the slight similarities between Java and JavaScript is that some people who know one of them thinks that they ought to be able to write using the other when in fact the two languages are very different from one another.

I guess having Java programmers write garbage that they think is JavaScript is probably even more common than having JavaScript programmers write garbage that they think is Java.