Proof of Concept For Ajax Without JavaScript 148
JonathansCorner.com writes "Even if Ajax was backronymed to 'Asynchronous JavaScript and XML,' it works with JSON substituted for XML. Here's a proof of concept that JavaScript/VBScript are not strictly necessary either. The technique, besides being used standalone, may be useful to provide a better 'graceful degradation' for Ajax applications used by clients with scripting turned off."
iFrame? (Score:1, Informative)
Like a true slashdotter I have not read the article, but the precursor to AJAX was just to use iFrames (or pre-iframe frames). Is this any different or better?
Re: (Score:1)
Apprently.
I find this line interesting:
the reason browser back buttons work in Gmail is an invisible, seamless use of iframes that create browser history.
Isn't this actually due to the use of # in the URL when you click things?
Re: (Score:2)
Sorry. By "Apprently" I meant "Apparently," and by "Apparently" I actually meant "Apparently not."
-1, spelling mistake
Re: (Score:1, Interesting)
Apprently. I find this line interesting: the reason browser back buttons work in Gmail is an invisible, seamless use of iframes that create browser history. Isn't this actually due to the use of # in the URL when you click things?
Actually it is a bit more complex than that. A Hash is just an link to an anchor on the current page. I am not sure how gmail works exactly, but I use extjs at work and it manages the history with an iframe as well. It needs a way to keep track of all the history tokens so it uses an iframe. Check out its source code if you are interested. http://www.extjs.com/deploy/dev/docs/source/History.html [extjs.com]
Re: (Score:2, Interesting)
going backward and forward updates the has component in the url. A timer event monitors the url. If the hash changes, then you update your app state, etc.
The iframe is a hack for IE. IIRC, If you programmatically set the url hash, it doesn't go into the IE browser history, so back/forward are broken. But if you update the iframe address, it does update the history.
Re: (Score:2)
Re:iFrame? (Score:5, Informative)
Degrades gracefully? I think not. Here's the page. (Score:2)
Sat Apr 24 13:50:18 2010
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
220 print_palette_frame()
221 elif get_cgi(u'page') == u'showcase':
222 print_showcase_frame()
223 elif get_cgi(u'page') == u'text':
224 print_te
Re:Degrades gracefully? I think not. Here's the pa (Score:2)
<type 'exceptions.OSError'> Python 2.5.2: /usr/bin/python
Sat Apr 24 13:50:18 2010
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred. /home/jonathan/mirror/ajax/server.cgi in ()
[snip]
All those lines of code sure would be easier if they were sorted by line number ... maybe this 'JAXless AJAX can format the errors in a new way, too?
Re: (Score:2)
1998 exactly (Score:1, Flamebait)
In 1998 I did this while working for Davinci tech in Toronto working on Coke Canada Intranet accounting site (remember, the Intranet was the buzzword of the time?) IFrames + javascript refreshing them and populating parent windows / frames.
There is NOTHING new in programming technology and hasn't been for a longest time. Really, in 16 years I can only truly say that bit-torrent was somehow a unique/new idea, but I think even that wasn't that radical, just the protocol was new.
Re: (Score:1)
remember, the Intranet was the buzzword of the time?
Yeah, that and "push" technology. Anyone remember "push" technology, or is it just me? IIRC, it was supposed to be the opposite of "pulling" data off the web by visiting a website. Data would be sent to a program on your desktop...kind of like RSS/Atom
Re: (Score:2)
RSS/Atom are not push. Your RSS reader just regularly checks the feed for updates.
Re: (Score:1)
I know, but most of what people called "push" technology in those days (based on my admittedly hazy recollection) simply involved software that would poll for updates like an RSS reader. That was the best case. In the worst case it just meant using a cron script to send automated emails. That's why it was more of a buzzword than a true technology (involving server-initiated communication).
Re: (Score:2)
RSS/Atom are content formats, and can be used for polling (not really "push", but what mostly passes for it) updates, or in a system that does real push (e.g., Google's PubSubHubbub push protocol, which strictly sspeaking isn't limited to Atom, but only has defined semantics for Atom.)
Re: (Score:3, Insightful)
There is NOTHING new in programming technology and hasn't been for a longest time. Really, in 16 years I can only truly say that bit-torrent was somehow a unique/new idea, but I think even that wasn't that radical, just the protocol was new.
I mean this in the nicest possible way, but the only reason why you think that is that you have an extremely limited perspective on programming.
Re: (Score:2)
Spare your pity :)
Nothing has been happening in programming that is new in any way for decades now, I mean it and I welcome a single real example to the contrary.
Re: (Score:2)
What exactly do you mean by "new"?
Re: (Score:2)
New, as in the concept is new, the principles are new and unique and weren't done before in some other incarnation.
I consider bit-torrent protocol to be such a new unique thing as the latest example.
Re: (Score:2)
And perhaps one day a slashdotter will penetrate a girl.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2, Funny)
AJAX itself is 1960's technology. I mean holy shit, people get a fucking stiffy over being able to update a user interface without pushing a button.
Re:iFrame? (Score:4, Funny)
Like a true slashdotter I have not read the article, but the precursor to AJAX was just to use iFrames (or pre-iframe frames). Is this any different or better?
Well, it's AJAX without all the pesky 'JAX' ... but it does have an iFrame*, so it's 'Ai' ... not to be confused with 'AI' which is something completely different. Now, the 'Ai' may have a JSON appended to replace the 'X', which would make it 'AiJ' which is completely different from AJAX, though not necessarily better (not necessarily as in not).
... though I think iFrames are about as popular with good web designers as iApples are with Linux coders.
* iFrame has no relation to iPads, iPhones, iPods or any other iApple product. The occurrence of the vowel is purely coincidental
Re: (Score:2)
The guy just invented the iframe it seems.
Also... since AJAX is an acronym for Asynchronous Javascript And XML this would be AI? Asynchronous Iframe?
and the grounbreaking solution is.... iframe (Score:1, Insightful)
Seriously? has existed longer than 'Ajax', this is not a new development or a novel new spin on existing tech. This is just, well, using/i> iframes.
Lame.
iFrames? (Score:5, Funny)
Been using iFrames to get around web restrictions since before you lost your virginity...
Re: (Score:1)
Been using iFrames to get around web restrictions since before you lost your virginity...
since your mother did
Re:iFrames? (Score:5, Funny)
... before you lost your virginity...
You're making a pretty big assumption there....
Re: (Score:2)
Ditto. I was one of the first to do this. Actually I also used object tags.
HTTP POST = outgoing packet. And the result were incoming ones. I had two implementations. One doing constant polling of the server for incoming packets and one constantly keeping an open connection with the server sending keepalive packets.
I could serialize any data that JS could represent into my own lightweight form of EBML (a efficient binary markup) to the PHP server and deserialize them into PHP objects, or the other way around
Re: (Score:2)
I don't recall exactly, but it was with a version of IE, that if you copied or pasted in the URL field, it gave you an alert that said "Feature not implemented".
Re: (Score:3, Funny)
No, it just means he could have been doing it last week, and it would still be before you lost your virginity /rimshot
Re: (Score:1)
I'm a Catholic priest, you insensitive clod!1!!
Re: (Score:2, Insightful)
Never waste your mod points on AC.
Continuous server polling (Score:2)
Just working on an online Rock Paper Scissors game [rpsmatch.com] .... I didn't want to get into javascript before sorting everything out without it. But everything seems to work fine, just by using
So I think I can keep javascript out of the game code
Stephan
Re:Continuous server polling (Score:4, Funny)
Just working on an online Rock Paper Scissors game [rpsmatch.com] .... I didn't want to get into javascript before sorting everything out without it. But everything seems to work fine, just by using
META HTTP-EQUIV="Refresh" CONTENT="3/...poll-url"
So I think I can keep javascript out of the game code
1994 weeps for your server and network load, especially since /. is going to give you a free scalability test in 3, 2, 1
Re: (Score:1)
It's already exploded. I started a game and then it told me that game was full when I tried to join it.
Re: (Score:2)
We'll get there. Please try again.
Stephan
Re: (Score:2)
404. And if you're going to knock off twitter's logo, at least learn how to make antialiased shapes in photoshop.
CGI scripts (Score:3, Insightful)
Site is Slashdotted.
And this is the reason why you shouldn't use CGI scripts these days - the interface sucks and forking a process for each request is very expensive.
By the way, before any Perl-bashing trolls come around: they're CGI scripts written in Python (How shocking, huh? Anything sucks when you're using plain old CGI).
Re: (Score:3, Insightful)
If you are forking a sub-process for every CGI script call, you're doing it wrong .-)
Fastcgi came around in the nineties and there exists various pooled process executors for various techs (perl, C etc).
I agree CGI is a web relic, but it isn't necessarily as bad as you painted it.
Re: (Score:2)
I'm talking about plain-old CGI, specifically.
FastCGI is great and I've deployed several Perl applications using it.
Re: (Score:3, Interesting)
CGI can (and does) work just fine. What people need to understand in general is that anything you do dynamically, has to be done efficiently. An old company I worked for had a heavily-used site for the day, on modest hardware. CGIs in C, using file access to parse template files and stuff with content. The CGIs forked, so did Apache, but it was unnecessary database use which we learned to avoid.
The system which replaced it was supposed to permit new content to be added with minimal dev help, and used Java a
Re: (Score:2)
The site advocates doing all the processing on the server, rather than offloading it to the client via JavaScript... can we spot any flaws there?
Re: (Score:1)
Re: (Score:2)
Not for a site with useless content like this.
Re: (Score:2)
A more consistent cross-browser experience?
Re: (Score:3, Interesting)
You're suggesting sites which use AJAX heavily have never been slashdotted?
With non-AJAX sites, the pages are smaller without all the javascript, including code for every different bug in every different browser is not only a programming nightmare, but makes for a far less responsive page...
Everyone treats it like a foregone conclusion that AJAX is faster... It
Re: (Score:2)
You're suggesting sites which use AJAX heavily have never been slashdotted?
I didn't mention using AJAX or not using AJAX a single time in my original comment. You can use have a "real" AJAX site using plain-old CGI, I've done that myself. Hell, you can even run full-blown MVC frameworks such as Perl's Catalyst using CGI - it will just be slow as hell, but you can run it.
CGI is only the interface and my point is that forking a process for each request sucks.
Your site can still be Slashdotted even if you're using something like FastCGI, mod_xxxx and so on. But instead of being Slash
Re: (Score:3, Informative)
Anything that depends on user input and can't be predicted before loading the page _will_ be faster with ajax if the server, client and internet connection are fast enough.
Rendering a full page is much heavier for the server so in that aspect it's an advantage.
Loading a full page for a client is heavier because there's more to parse.
Loading a full page takes up more bandwidth so it's worse on your internet connection too.
So there are only 2 cases I can think of where it might not be noticably faster.
1. A hi
Re: (Score:2)
Hardly. Rendering one large page in response to a request, rather than 10 smaller requests, does not really decrease load.
Except loading a page is handled MUCH differently from dynamic changes to an existing page, such that loading a full page is faster...
In
Re: (Score:2)
It really does depend on what you're using Ajax for, like you sort of said. Google Suggest was the "first" very noticeable public demo of what Ajax was, and it's a very good application. However, a lot of developers found their proverbial hammer and decided that Ajax to refresh most or all of the page is somehow better, where in fact there's the additional steps of variable evaluation and DOM insertion before you even get to a browser render.
Rendering one large page in response to a request, rather than 10 smaller requests, does not really decrease load
This really depends on what's happening behind the scenes. Small r
Re: (Score:2)
3) The designer and/or programmer are of average skill or lower
Re: (Score:3, Insightful)
Wow. How's the weather back in 1998?
I've got a PC that I built for $300 in 2008, and two macbooks (the bottom of the line models. Not t
Re: (Score:2)
With ajax it depends heavily on the browser, on modern browsers good ajax usage is way faster than plain html, on older browsers it can become a problem, but it all depends on the usage and
on how much of the dom is updated client side.
Re: (Score:2)
Why is this modded anything apart from off-topic? "The web server is dead, and therefore I'm going to rant about something that has absolutely nothing to do with the summary whatsoever."
Good work, mods.
Re: (Score:2)
> And this is the reason why you shouldn't use CGI scripts these days - the interface sucks and forking a process for each request is very expensive.
No it isn't. This is a common myth that just never dies.
I have built a whole web framework [cat-v.org] with the rc shell [cat-v.org] that does dozens of forks per request (calling commands like sed, awk, grep, echo, cat, etc), it is much faster than some php frameworks using fcgi, and certainly many magnitude order faster than perl or python takes to even start up.
You can do many t
Re: (Score:2)
In short, the problem is not fork, bu ridiculously bloated and overly complex software.
it has been said that process creation is cheap on Unix and expensive on NT, while the reverse is true of threads.
Re: (Score:2)
That is generally true, but there are exceptions, some badly broken supposedly "unix" systems like Aix and Solaris have ridiculously bloated and slow processes.
Fortunately most such abominations are either dead or dying fast, and being replaced by systems like Linux where processes are extremely cheap (so cheap that 'threads' are implemented as pretty much normal processes that happen to share memory, in the style of Plan 9's rfork(2) [cat-v.org]).
Re: (Score:2)
That is generally true, but there are exceptions, some badly broken supposedly "unix" systems like Aix and Solaris have ridiculously bloated and slow processes.
Is that why Solaris was one of the first Unixes to have a mature threading library? I always wondered.
Nothing to see here, etc (Score:4, Informative)
So you post a form to an iframe by pressing a submit button, and the iframe reloads with new dynamic content? And this is somehow AJAX? The whole interesting thing with AJAX is that you can interact with the web server while staying on the same page. You can type something into a search box, say, and the webserver sends you back some matching words in real time. Sure you could mimic the same thing with a POST and a results page, but that is exactly the paradigm that AJAX was supposed to replace.
Re: (Score:2)
...The whole interesting thing with AJAX is that you can interact with the web server while staying on the same page...
And without taking the pageload/parsing penalty.
Re: (Score:2)
And this is somehow AJAX?
No, it's not AJAX. That is, I think, his point. the point. The point of the demonstration doesn't seem intended to replace AJAX, but to provide a graceful degradation for those with Javascript turned off.
How is this new? (Score:5, Insightful)
Posting to an iframe and loading the iframe with dynamic content?
Haven't RTFA (slashdotted), but I used to do "AJAX" without "AJAX" in the early 2000's. You would post to a hidden iframe and the dynamic content that was loaded in the iframe was Javascript, which would manipulate the parent page. Either that or it was JSON would you would then access from the parent page.
Re: (Score:2)
I guess this guy just found out about them?
Yah, I also was using iFrames to pass data around long before the term "AJAX" was coined.
Re: (Score:2)
Re:How is this new? (Score:4, Informative)
Re: (Score:1, Troll)
It's not new. I got to the article before it was slashdotted. The author (who is also the author of the story) created a python script that spits out different inline CSS depending on the button you select to style some text, loading it into an iframe, in other words the sort of messy 'dynamic' pages that many sites used before being replaced by AJAX.
It's often messy, but doesn't have to be. For that matter AJAX can get ugly and messy at times.
I think the good point to take away from this, that many sites seem to have tossed away, is to provide a way to interact with the site if a user has Javascript disabled. One thing /. pedants often harp and bark about is how they have Javascript disabled and their shock that everyone doesn't. Maybe site owners and developers aren't interested in providing their pages to those who won't allow them to run JS, but
Re:How is this new? (Score:4, Informative)
Me too. The framework I used was JSRS [ashleyit.com]. IIRC, it worked by creating hidden iframes on the fly for server-side communication and had dispatchers for PHP, ASP, perl and others. I don't recall if it was asynchronous or not, but pretty much anything can be made asynchronous in javascript by using the setInterval or setTimeout functions. The only thing I could tell was different was the fact that AJAX used the XMLHttpRequest object.
So, naturally I was dumbfounded when people started talking about how amazing and cool AJAX was. I thought, "Hasn't this been around for years?"
Re: (Score:2)
Indeed, the page you linked to mentions MSRS, which was one of the Java applet approaches to AJAX which existed in the "version 4" browser time frame. (XMLHttpRequest only came about after MS pulled MSRS due to the Sun lawsuit over Java.)
As for the lack of understanding of AJAX-like techniques, some theories:
- Netscape 4 and early versions of Mozilla were not stable with heavily dynamic pages, so devs tended to avoid them
- Developers did not understand Javascript and DOM in general - real programmers thoug
Re: (Score:2)
I love it when everything old is new again. I mean, you know, good for the kids to be trying stuff, but maybe they should read a little history so they work in new stuff instead of reinventing the wheel.
Anyone remember server side image maps? Or how about server side push animation [radzone.org]?
Yeah, don't reinvent those either.
Re: (Score:2)
Re: (Score:2)
The 2000's? I used to do AJAX without AJAX in the early 1990s! The way you do it is you build a thin client with your own rendering engine, compression and protocols, you mail it to everybody every day so it's ubiquitous, then you put a few hundred thousand modems in colos and serve the content through those.
The CGI-haters are right, though. Even we knew enough not to fork a process per request. AOLserver FTW.
Not Ajax (Score:2, Informative)
Re: (Score:2, Offtopic)
Re: (Score:2)
iPhone = 1G, iPhone 3G = 2G, iPhone 3GS = 3G, next iPhone = 4G, for values of G equal to Generation. Hint #G doesn't have to refer to the network. Apple products have traditionally been referred to by the generation scheme as in: "I have a 5th generation iPod," or " I have a 3rd generation MacBook."
Re: (Score:1)
Re: (Score:2)
iPhone: iPhone1,1
iPhone 3G: iPhone1,2
iPhone 3GS: iPhone2,1
so... what do you think the chances are of Apple pulling a "Rocky II" and completely skipping their own internal 3rd hardware r
Re: (Score:2)
No, that is the model identifier and doesn't have much to do with the generation of a product. I never said it was formal designation either. It's only confusing if you make it confusing.
Re: (Score:2)
No, that is the model identifier
correct
and doesn't have much to do with the generation of a product.
Incorrect. Apple's model identifier has everything to do with what hardware generation the device is. It is one of the ways we know the differences between, and how we talk about the generational differences in the hardware. Obviously, a name doesn't magically make something a new generation. But Apple was kind enough to match their internal model identifiers to hardware generation for us. That's how they do it, and if you didn't know, that's what they're intended for (internally), and that's what t
Next up... styling without CSS (Score:5, Funny)
Courtesy of the font tag.
Re: (Score:2)
Hey, don't forget our old friend <table>!
Re: (Score:2)
Who of you remembers actual <layer> tags? :D
Creating a keyboard-controlled Tetris on Netscape Navigator 4.5 ruled! :D
This is news? (Score:3, Insightful)
Re: (Score:2, Insightful)
Re: (Score:2)
Wow. The barrier to entry for getting a comment on slashdot has really lowered, hasn't it? How is this even worth mentioning? ;)
thanks for the info... (Score:1)
Bad idea (Score:1)
Re:Bad idea (Score:4, Funny)
That it is better to be a fool and remain silent, than to speak and remove all doubt.
Back in my day... (Score:1)
client side BAD IDEA (Score:1, Redundant)
- it is something that happens in a remote client pc, on which you dont have any control. there may be one small applet running in the tray, and it may fuck up execution of your code on that pc, costing you a visitor/sale/whatever.
- client side scripting is a VERY good channel to infect visitor pcs, and this is why trojans, viruses are bein
Re: (Score:2)
google, facebook, twitter has he resources to unload huge development time to compatibility, assurance, whereas REST of the web does NOT.
nothing happens if an average joe's computer locks up while visiting twitter, he is just one in a million or more hits every day, and he will just come back, because it is a prominent site.
for the rest of the web, for example for a small estore that gets 2000 uniques a day and does 10 sales, one potential customer lost is a big deal.
therefore,
Old is new again? (Score:2)
First off, the "proof of concept" does not prove that you can do AJAX without the J. It presents a very simple use of the "target" attribute to the <a> tag that has been around since, oh, 1995 or 6 (with real frames, to be fair, but thats academic. Iframes were only invented because paper-obsessed layout & design types didn't like the frame bars).
What it does prove, and it's a valid point, that there is plenty of page automation you can do without dependency on J or X. These days, because of the m
It isn't a backronym (Score:3, Informative)
Re: (Score:2)
I was going to say exactly the same thing. Even more frustrating is that the Wikipedia article linked to makes no mention of it being a backronym either; the guy hasn't even read (or perhaps hasn't understood) his own reference.
It's not new, and it isn't Ajax. (Score:2)
These are the same sort of piss-poor "web professionals" who swear you need Javascript to do interesting things with menus. Hint: with CSS, you definitely don't.
I'd put up a link to one of my own proofs of concept, but I don't want to /. my own server. Maybe the guy who wrote the silly article submission has some spare bandwidth for me?
Sheesh (Score:2)
This guy is promiting iFrames as Ajax alternative, this technique has been used before Ajax was there and there was/is a reason why Ajax is used for ppr, and that is flexibitlity, and iframes can cause hanging endless connections.
Heck iFrames even still are used with Ajax as transport layer (in combination with javascript)
because the ajax is broken due to the fact that it does not allow multipart form requests.
I still do not know why this article made it on slashdot, it would be more interesting if it was t
Re: (Score:1)
Re: (Score:1)
that explains the ugly bulges
Re: (Score:2)
You seem to be suffering from amnesia. Let me remind you of two older, more-hated failures: the <BLINK> tag and the <MARQUEE> tag.