Hello, sir:
I have similar problem.
I used a mainpage to load javascript dynamically through ajax. The javascript is loaded on the body onload function. The problem is that the returned javascript cannot be used, looks like the scope is wrong. I used alert to show the script text, and it is correct.
any clue to make the ajax returned javascript into gobal scope?
Thanks
User Profile
Collapse
-
Thanks.
I have added the session_start, and have changed to POST. and it worked.
The problem is that I returned a Javascript function, and used eval(); but it seems that the script scope is wrong, I cannot use the function.Leave a comment:
-
PHP ajax session does not work
hello, all:
I am having trouble to make ajax work for my tiny php app.
I have a index.php file, which is
[php]<?PHP
session_start() ;
$_SESSION['ajaxKey'] = md5(uniqid(rand (), TRUE));
?>
<script src="clienthint .js"></script>
<script>
var ajaxKey = '<?PHP echo $_SESSION['ajaxKey']; ?>';
</script>
</head>...
No activity results to display
Show More
Leave a comment: