Rasmus' 30 sec AJAX tut help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
oonoo
Forum Newbie
Posts: 3
Joined: Tue Oct 25, 2005 8:41 am

Rasmus' 30 sec AJAX tut help

Post by oonoo »

greetings! :)

believe, most of you have read this popular tutorial.. and bet only i get troubles with it. I'm starting with php and quite familiar with how javascript works so I can relate to all the codes in it.

http://marc.theaimsgroup.com/?l=php-gen ... 625636&w=2

Ok here are my questions:

how many files does the technique in the tut require? and in which file should the codes from tut appear?

im a noob. so do pardon me!

ofcourse, thanks in advance!
Last edited by oonoo on Tue Oct 25, 2005 9:17 am, edited 1 time in total.
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

The Javascript goes in one page:
First the Javascript:
and
Now, look at handleResponse....
The other page:
In rpc.php you might have something like this:
oonoo
Forum Newbie
Posts: 3
Joined: Tue Oct 25, 2005 8:41 am

Post by oonoo »

hi! :)

thats exactly how I tried it.

a test.php which contains the javascript in the header.. and in the body the anchor(<a href...>foo</a>) and a

Code: Select all

<div id="foo">
</div>
under it.

I created an rpc.php with nothing(as in nothing) but these

Code: Select all

switch($_REQUEST['action']) {
    case 'foo':
      /* do something */
      echo "foo|foo done";
      break;
    ...
  }
...

then I loaded test.php and clicked on the foo and nothing happened. :D
Post Reply