Javascript+PHP vs. Ajax

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Javascript+PHP vs. Ajax

Post by JellyFish »

What can Ajax do (Javascript and XML) that Javascript and PHP can't do?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

you're comparing apples and oranges.

Ajax is not synonymous with XML and XML is not compariable to PHP.

'Ajax' or XMLHttp is a javascript object that can interact with PHP or any other back end server side language and communicate via XML (or not).

I would hit up wikipedia for Ajax if I were you.
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Post by JellyFish »

Okay. Danka you Burrito. I'll be back if I have more questions after my research. :D
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

yup, you don't even have to use XML... JSON is much cooler for most things... it can be parsed natively by Javascript, because it's just a subset of object literal notation.
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Post by JellyFish »

What I mean is. Can I go through the whole website without any page refreshes with PHP+Javascript?
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Post by Zoxive »

JellyFish wrote:What I mean is. Can I go through the whole website without any page refreshes with PHP+Javascript?
Thats what Ajax does.. Ajax simply is just Javascript that uses the XMLHttp Object..

This page helped me out when i first started playing around with Javascript/Ajax.

-NSF
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Post by JellyFish »

Yeah but I don't know Ajax, will eventually learn it. Does Ajax have access to mySql database? Can javascript and php access mysql database without any page refresh???
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

I think you are getting confused... AJAX is NOT a language of any kind. AJAX is a technique. Basically the idea is: Using client-side code (Javascript) to send a request to server-side code (PHP, Ruby on Rails, JSP, etc.) which returns some sort of structured data (structured data could be anything from a comma-delimetted list to JSON and XML) which is then parsed and/or executed by the client code... all without refreshing the page.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

To be extremely to the point: AJAX is JavaScript + PHP.
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Post by JellyFish »

Yeah Ajax is a combanation of technologies, but I never knew php was included the list of those technologies. Thanks for clearing that up guys. :D
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

pretty much anything that can generate output to the browser is included...
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

JellyFish wrote:Yeah Ajax is a combanation of technologies, but I never knew php was included the list of those technologies. Thanks for clearing that up guys. :D
It doesn't have to be PHP specifically; it just needs to be a server side language. ASP, Perl or JSP would all work as well as PHP :)
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

d11wtq wrote:
JellyFish wrote:Yeah Ajax is a combanation of technologies, but I never knew php was included the list of those technologies. Thanks for clearing that up guys. :D
It doesn't have to be PHP specifically; it just needs to be a server side language. ASP, Perl or JSP would all work as well as PHP :)
Technically it doesn't even need to be that... you can request a static page and parse the results with javascript if you really want to...
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

The Ninja Space Goat wrote:Technically it doesn't even need to be that... you can request a static page and parse the results with javascript if you really want to...
Ok smart ass :D :twisted:
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

:twisted:
Post Reply