Author Topic: Making a javascript call from within obj.innerHTML return?  (Read 1055 times)

0 Members and 1 Guest are viewing this topic.

Offline woolygTopic starter

  • Enthusiast
  • Posts: 248
    • View Profile
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:
Code: [Select]
$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

Offline CodeMaster

  • Irregular
  • Posts: 39
  • Gender: Male
    • View Profile
Re: Making a javascript call from within obj.innerHTML return?
« Reply #1 on: May 15, 2010, 02:29:51 PM »
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.