开发者

Calling and executing javascript function from php echo call (print) internet explorer 7

开发者 https://www.devze.com 2023-04-01 02:21 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号