javascript - JS alert in PHP as part of AJAX app -
I have found a PHP file which is being asked to fill a DIV via AJAX. Everything works well and does not divide, except that I can not get the JS warning box popped up with PHP for my life.
What I'm using to test here (at the end of PHP, I have tried it at the beginning, middle, etc.):
< Code> echo "what does this show?"; Echo "& lt; script language = 'javascript' & gt; warning ('thank you!'); ";
"Does this show?" Resonated and I can see JS in codeinspector but no warning box. If I take that code and put it in my PHP file (hence it is no longer embedded as part of a larger AJAX app) it works fine.
Any suggestions?
Send scripts
blocks back via AJAX incorrect There is a way to do this. For example, for example, P>
PHP:
For example, for example (untested, but you get this idea):
For example, echo json_encode (array ('operationscooked' => gt; 'true', 'message' = & gt; 'test'));
Javascript:
retValObj = JSON.parse (retVal); If (retValObj.Message! = Null) {Warning (retValObj.Message); }
Comments
Post a Comment