I've got a problem with internet explorer not executing the javascript that I print out via php. It works in all the other browsers; I've boiled it down to the essence of the issue. This will not work in ie 7.
<?
echo '<script type="text/javascript" language="javascript">alert("WTF");</script>';
<body></body></html>";
?>
Have also tried variations on type and language tags as well as doing stuff like this
echo "<html><head><script language='JavaScript'>alert('Captcha Failed');</scrip开发者_运维知识库t></head>
Anybody got any ideas? Thanks.
<?
echo "<script type=\"text/javascript\">alert('WTF');</script>";
?>
<body></body></html>
Thats how I always do it. I escape double quotes for HTML tag attributes and echo out with doubles too unless otherwise necessary.
精彩评论