I have webpage 1 which when a button is clicked calls up an ajax script, this ajax script also has a button that when clicked should call a second ajax script. The first part works fine, the second does not work at all.

I am slightly confused as to where I should have my second ajax function. Should I have it in the head of webpage 1 or in the head of the first ajax script called. I have tried both ways and neither works.

And as for the file(s) that you open with ajax, just treat them as if they are the HTML inside of the div you're assigning it to (hence, innerHTML)... i.e., you don't need <head>, <body>, etc. tags. So your file "getAjax1.php" would look something like this:

(The <div class="standard"> portion of the code may be redundant but it depends on if you plan on having different classes for the div for different files.)

Jenny Dithe

09-29-2010, 05:23 AM

Thank you that helps a lot and I can see how that simplifies things, the only problem I am having is that it doesn't call the file and I get an error warning File is not Defined. I tried playing around with this and using variables, etc, but that didn't work.

I can see that it is almost there, but can't quite see the missing piece of the puzzle.