[thelist] php/ajax...

Christian Heilmann codepo8 at gmail.com
Mon Aug 7 14:47:44 CDT 2006


> [snip]
> > You will only need JavaScript.
>
> That statement may not be true. For example the computation might have
> to involve a database or web service lookup.
> [/snip]
>
> True, and you will only need JavaScript, since Ajax essentially uses
> JavaScript to perform the request, no?

Only if the service returns JSON and you can use a dynamic script
element[1]. If the service does not do that you will need a server
side proxy script that allows you to reach outside your own Domain[2].
XMLHttpRequest, the driver of Ajax cannot reach scripts not on the
same domain for security reasons. Dojo offered a way around that[3] in
the newest version, using hidden iframes as the proxy which results in
annoying click sounds in MSIE and might actually throw up more errors
as we progress. Ajax is NOT client side, it is a middle tier between
client and server side.

[1] http://icant.co.uk/sandbox/jsonsearch/
[2] http://www.beginningjavascript.com/Chapter8/index.html (example
"Retrieving external RSS feeds with PHP and XHR")
[3] http://dojotoolkit.org/~jburke/XHRIFrameProxy.html

-- 
Chris Heilmann
Book: http://www.beginningjavascript.com
Blog: http://www.wait-till-i.com
Writing: http://icant.co.uk/



More information about the thelist mailing list