Proof of Concept For Ajax Without JavaScript
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."
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?
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.
Been using iFrames to get around web restrictions since before you lost your virginity...
Just working on an online Rock Paper Scissors game .... 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
http://stephan.sugarmotor.org
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).
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.
Python 2.5.2: /usr/bin/python
/home/jonathan/mirror/ajax/server.cgi in () /home/jonathan/mirror/ajax/server.cgi in print_showcase_frame() /usr/local/lib/python2.5/commands.py in getoutput(cmd=u'/usr/local/bin/link') /usr/local/lib/python2.5/commands.py in getstatusoutput(cmd=u'/usr/local/bin/link')
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_text_frame()
print_showcase_frame = <function print_showcase_frame at 0xfbcec1ec>
149 css = styles[get_style()]
150 text = get_cgi(u'text')
151 link = commands.getoutput(u'/usr/local/bin/link')
152 timestamp = time.asctime(time.gmtime()) + u' UTC'
153 print u'''<html>
link undefined, global commands = <module 'commands' from '/usr/local/lib/python2.5/commands.pyc'>, commands.getoutput = <function getoutput at 0xfbce6fb4>
42 def getoutput(cmd):
43 """Return output (stdout or stderr) of executing cmd in a shell."""
44 return getstatusoutput(cmd)[1]
45
46
global getstatusoutput = <function getstatusoutput at 0xfbcec02c>, cmd = u'/usr/local/bin/link'
51 """Return (status, output) of executing cmd in a shell."""
52 import os
53 pipe = os.popen('{ ' + cmd + '; } 2>&1', 'r')
54 text = pipe.read()
55 sts = pipe.close()
pipe undefined, os = <module 'os' from '/usr/local/lib/python2.5/os.pyc'>, os.popen = <built-in function popen>, cmd = u'/usr/local/bin/link'
<type 'exceptions.OSError'>: [Errno 35] Resource temporarily unavailable
args = (35, 'Resource temporarily unavailable')
errno = 35
filename = None
message = ''
strerror = 'Resource temporarily unavailable'
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.
Vivin Suresh Paliath
http://vivin.net
I like
<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?
It's not asynchronous, as the "ajax" parts have to load a whole new page with a new request. Ajax without JavaScript or iframes is multipart/x-mixed-replace.
Courtesy of the font tag.
Wow. The barrier to entry for getting an article on slashdot has really lowered, hasn't it? How is this even worth the blog post?
Python 2.5.2: /usr/bin/python
Sat Apr 24 14:34:09 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 ()
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_text_frame()
print_showcase_frame = /home/jonathan/mirror/ajax/server.cgi in print_showcase_frame()
149 css = styles[get_style()]
150 text = get_cgi(u'text')
151 link = commands.getoutput(u'/usr/local/bin/link')
152 timestamp = time.asctime(time.gmtime()) + u' UTC'
153 print u'''
link undefined, global commands = , commands.getoutput = /usr/local/lib/python2.5/commands.py in getoutput(cmd=u'/usr/local/bin/link')
42 def getoutput(cmd):
43 """Return output (stdout or stderr) of executing cmd in a shell."""
44 return getstatusoutput(cmd)[1]
45
46
global getstatusoutput = , cmd = u'/usr/local/bin/link' /usr/local/lib/python2.5/commands.py in getstatusoutput(cmd=u'/usr/local/bin/link')
51 """Return (status, output) of executing cmd in a shell."""
52 import os
53 pipe = os.popen('{ ' + cmd + '; } 2>&1', 'r')
54 text = pipe.read()
55 sts = pipe.close()
pipe undefined, os = , os.popen = , cmd = u'/usr/local/bin/link'
: [Errno 35] Resource temporarily unavailable
args = (35, 'Resource temporarily unavailable')
errno = 35
filename = None
message = ''
strerror = 'Resource temporarily unavailable'
What concept is this proof of?
www.blueapples.org
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
sliced bread!
RSS/Atom are not push. Your RSS reader just regularly checks the feed for updates.
You must not do much in python, they almost always go like that, it's from the outer most function call to the inner most that generated the error, they are also mostly in different files, so sorting by line number would be of little help.
All of the above was encrypted with a Quad ROT-13 method. Unauthorized decryption is in violation of the DMCA.
I used toothpicks and duct tape before all this new fangled Ecmascript and whatever-format-you-care-about naming it after a famous Greek warrior.
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).
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.
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.
You can't handle the truth.
that explains the ugly bulges
Table-ized A.I.
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 maddeningly and increasingly high-level focus of web development, a web programming shop will immediately reach for the AJAX hammer to hit even the simplest nails, instead of using the most efficient tool for the job.
Before AJAX we had DHTML, before DHTML there was cross-frame scripting, and before that there was client pull and server push. We do nearly all of these things now with AJAX and as a result, simple tasks are developed as unnecessarily complicated monstrosities.
Terrorists can attack freedom, but only Congress can destroy it.
I didn't find bittorrent all that different from eDonkey, which used a similar hashing system to figure out that a bunch of people had the same file, and would let you download multiple chunks from different people.
Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
What exactly do you mean by "new"?
<xml><I><am><so><damn>Web 2.0</damn></so></am></I></xml>
Or hitting multiple servers to ftp different parts of the same file by using "skip" to skip over a portion, then just cat them all together.
You seem to be suffering from amnesia. Let me remind you of two older, more-hated failures: the <BLINK> tag and the <MARQUEE> tag.
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.
You can't handle the truth.
The name is barely even five years old and already people forgot where it came from? Here's the blog entry where the term was coined. The technology was around before the term was coined, but that doesn't make it a backronym. After all, when we discover new things and don't come up with a name until later, that's not a backronym, it's just a name. Sure, Ajax is an acronym, but its letters weren't given a meaning after the fact like you would with a backronym (e.g. "bump" meaning "bring up my post" on message boards). Rather, the letters were given meaning at the same time that the term itself was coined, as the blog entry I linked shows.
why so anonymous ?
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, due to its expensiveness and lack of guarantees for assurance, so far client side didnt spread around the net, except only the big boys.
Read radical news here
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?
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 talking about the html5
websockets, which finally will get us rid of that pesky ajax.
Girls are now penetrating the industry ;)
-Alex. http://bit.ly/1iVPtfA
And perhaps one day a slashdotter will penetrate a girl.
And on that day, we shall have:
AJAX 2.0!
-Alex. http://bit.ly/1iVPtfA
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.)