JoshWelford
-
Posts
2 -
Joined
-
Last visited
Posts posted by JoshWelford
-
-
Hello all,
I was trying to use PHP to echo a Javascript function but it wasn't going well at all.
I am wondering, is it possible to do the following:
<script type="text/javascript"><span id="formResponse"></script>
Thank you,
Josh.
Use <span> inside script
in HTML Help
Posted · Edited by JoshWelford
Sorry, I didn't explain too well.
I want to do this: <script type="text/javascript"><span id="Response"></span></script>
The span will be filled with one of two variables from an Ajax request.
If something was inserted into a database echo "success()"
Or if there was an error echo "error();"
The function's are filled with notification-like messages.
So if the script is "success()" show the success notification
however if it's "error()" show the error notification.
Hope I cleared things up.