I'm *POST*ing to a PHP login script via an AJAX call. Upon success, I need to call a JavaScript function loggedIn()
. I tried having it print ...
<script type="text/javascript">loggedIn();</script>
... as the .innerHTML
of a div, as well as trying an onload=""
event on the div tag. Neither method allowed me to call the JavaScript function. I can print a letter inside the div and execute it on the onclick=""
event, but the whole thing I'm trying to get away from is actually having to click anything. Bascially, I want a header("...")
redirect (which also wouldn't work).
First, can someone explain what is actually happening? My bet is on the asynchronous nature of AJAX. Secondly, does anyone know a work around I might employ go about refreshing the page upon success?
Thanks as always, Z@K!