8 Replies - 736 Views - Last Post: 24 April 2011 - 11:58 AM

#1 cupidvogel  Icon User is offline

  • D.I.C Addict

Reputation: 31
  • View blog
  • Posts: 593
  • Joined: 25-November 10

PHP for AJAX?

Posted 24 April 2011 - 08:41 AM

Hi, I know Javascipt and jQuery well enough. Will this be sufficient to have a sound knowledge about AJAX, or do I require to know PHP before learning AJAX?
Is This A Good Question/Topic? 0
  • +

Replies To: PHP for AJAX?

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4332
  • View blog
  • Posts: 12,127
  • Joined: 18-April 07

Re: PHP for AJAX?

Posted 24 April 2011 - 09:06 AM

No you don't have to know PHP for AJAX. AJAX is purely javascript. Now AJAX could (and often does) make calls to a PHP script but it could be any type of script or page. Heck you can make a call to a simple HTML document you like. PHP itself has nothing to do with AJAX, you just see AJAX typically makes calls to a server-side script and give it variables to process but again it could be any language... you can make calls to an ASP page or ColdFusion or Ruby etc.

:)
Was This Post Helpful? 1
  • +
  • -

#3 cupidvogel  Icon User is offline

  • D.I.C Addict

Reputation: 31
  • View blog
  • Posts: 593
  • Joined: 25-November 10

Re: PHP for AJAX?

Posted 24 April 2011 - 09:26 AM

Okay, so you say AJAX occasionally invokes different types of scripts, one of which may be PHP. You mentioned others like ASP, Coldfusion, Ruby, etc. So do I require to learn them in order to know how to invoke those scripts via AJAX? Please say no!
Was This Post Helpful? 0
  • +
  • -

#4 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4332
  • View blog
  • Posts: 12,127
  • Joined: 18-April 07

Re: PHP for AJAX?

Posted 24 April 2011 - 09:29 AM

No, you don't. I was saying you typically would make ajax calls out to these scripts. You could even make a call to a text file or HTML file. The idea is that you call out to another source of data and pull in results back to the script without having to reload the page.

I could have a text file that has "hello world" written in it. I can then make a call in ajax to fetch this text file's contents. It would pull in "hello world" from the file and use it in something like a javascript alert() box and show the message "hello world" on the screen.

:)
Was This Post Helpful? 1
  • +
  • -

#5 cupidvogel  Icon User is offline

  • D.I.C Addict

Reputation: 31
  • View blog
  • Posts: 593
  • Joined: 25-November 10

Re: PHP for AJAX?

Posted 24 April 2011 - 09:39 AM

Cool. I will start learning AJAX right away! By the way, is AJAX an extensive language like Javascript or PHP? I mean PHP is such a vast language, there are so many things to learn in it, that it seems that there is no end. Is AJAX too that huge a language?
Was This Post Helpful? 0
  • +
  • -

#6 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4332
  • View blog
  • Posts: 12,127
  • Joined: 18-April 07

Re: PHP for AJAX?

Posted 24 April 2011 - 09:45 AM

Ajax IS Javascript.

The "j" in ajax is for "javascript"

Ajax stands for Asynchronous Javascript and XML. :)


Edit: Even though it has "XML" in the name, you will find that you may not even use XML. Most of the time you make calls out to simple web pages, text files etc. You can make calls to text files that hold JSON for instance.

It is just a mechanism in Javascript that takes advantage of the XMLHttpRequest object

This post has been edited by Martyr2: 24 April 2011 - 09:48 AM

Was This Post Helpful? 0
  • +
  • -

#7 cupidvogel  Icon User is offline

  • D.I.C Addict

Reputation: 31
  • View blog
  • Posts: 593
  • Joined: 25-November 10

Re: PHP for AJAX?

Posted 24 April 2011 - 09:49 AM

Yeah I know, I know. What I meant was that when I was leafing through an AJAX book for beginners, I found new terms like XMLHTTP Request, Open(), Send(), ResponseXMl, etc. This stuff is not part of Javascript, but works with Javascript, right? What I meant to ask is that is there plenty of this new stuff, or not much.
Was This Post Helpful? 0
  • +
  • -

#8 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3524
  • View blog
  • Posts: 10,169
  • Joined: 08-June 10

Re: PHP for AJAX?

Posted 24 April 2011 - 11:25 AM

this stuff is still Javascript. open(), send(), responseXML, etc. are all properties or methods of the XMLHttpRequest object. you work with it like you work with every other Javascript object.
Was This Post Helpful? 2
  • +
  • -

#9 cupidvogel  Icon User is offline

  • D.I.C Addict

Reputation: 31
  • View blog
  • Posts: 593
  • Joined: 25-November 10

Re: PHP for AJAX?

Posted 24 April 2011 - 11:58 AM

Cool. Thanks!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1