Jump to content

Recommended Posts

Hi all,

I'm making an AJAX call into a DIV, which is returning text, just fine. What I'd like to do is, when the text is, say, equal to '123', I'd like to do another ajax call, into a different DIV, that writes a different bit of text.

 

The first Ajax Call is returning the following PHP:

$text = $_GET['text'];

if($text == "123"){

echo "<script>ajax_call_root('c/ajax.comment.logged_in.inc.php', 'vote_ajax_bottom');</script>";

}

 

where 'c/ajax.comment.logged_in.inc.php' is the new php file to call, and  'vote_ajax_bottom'' is the target DIV.

 

Can this be done?

 

 

Cheers

WOolyG

You cannot execute javascript by putting it in an object with innerHTML. What you can do is, when you receive the response from the php page, check in javascript if the value is 123 and then make another ajax request.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.