Page 1 of 1

Rasmus' 30 sec AJAX tut help

Posted: Tue Oct 25, 2005 8:54 am
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!

Posted: Tue Oct 25, 2005 8:59 am
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:

Posted: Tue Oct 25, 2005 9:16 am
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