Click to See Complete Forum and Search --> : is it possible to use AJAX without javascript?


Jeff Banks
01-10-2008, 05:40 PM
I came across this article that explains how to use with a GET, but I want to use a POST. Is this possible?

http://www.phpit.net/article/ajax-php-without-xmlhttprequest/

JPnyc
01-10-2008, 05:46 PM
how would you update the page once the request is returned?

bpat1434
01-10-2008, 05:55 PM
Moving to Clientside Tech.

The short answer is: Yes, you can use POST as the method of transport rather than GET.

You can NOT use AJAX without Javascript, then you'd jsut have AAX... Asynchronous and XML.... not something that seems useful ;)

There are problems with that document though. While it is an alternative, you can't send anything to the server via POST as he has it set up. Also, there's no interactivity, so if you wanted to have "chats" with the server and client (for things like transparent authentication or things that require more than one round-trip) it can't really be done.

Not to mention, it's still susceptible to the "if Javascript isn't enabled, it won't work" ;)

Jeff Banks
01-10-2008, 05:58 PM
Well how about PJAX ?

What I'm trying to do is post to a REST style webservice. When I use the httprequest method, I have a problem with I.E and cross site scripting. Was thinking maybe that part could be handled on the server side.

bpat1434
01-10-2008, 06:08 PM
PHP has tools like curl that can send HTTP requests to other servers, and file_get_contents and fopen (both require fopen url wrappers to be enabled) can get the static contents of a regular page (with any $_GET stuff you want to send). Curl is best for things with sessions and POSTing data.

Jeff Banks
01-10-2008, 06:10 PM
Thanks for quick repsonse.

Will look into it.

dougal85
01-10-2008, 06:28 PM
You can NOT use AJAX without Javascript, then you'd jsut have AAX... Asynchronous and XML.... not something that seems useful ;)

Haha, that got my funny bone