0
  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.

0

1 Answer 1

2

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>
Sign up to request clarification or add additional context in comments.

1 Comment

Awesome, I didn't know that it had to be 2 separate script tags. Thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.