user2376313
user2376313

Reputation: 59

ajax help calling js function in php

  echo '<script type="text/javascript" src="../play.js">player_update();    creature_update();</script>';

I am trying to make these two scripts run when the data from my ajax files echo it to the screen. any help?

Ex: index.php sends data to .js file then js file sends the information to the servers php file which then returns the above script and runs the functions.

Upvotes: 0

Views: 48

Answers (1)

Quentin
Quentin

Reputation: 944441

A script element with a src will ignore the body of the element completely.

If you want two scripts, then have them in two script elements.

<script src="../play.js"></script>
<script>
player_update();
creature_update();
</script>

Upvotes: 2

Related Questions