在php中输出JavaScript从而实现网页跳转,这样写为什么显示语法错误呢?

echo "<script language="javascript">location.href="xxxxxxx"</script>";

第1个回答  2015-08-15
echo "<script language='javascript'>location.href='xxxxxxx'</script>";

里面的双引号要改为单引号。本回答被提问者采纳
第2个回答  2015-08-15
双引号放在双引号里时需要转义,或者用单引号
echo "<script language=\"javascript\">location.href=\"xxxxxxx\"</script>";
echo "<script language='javascript'>location.href='xxxxxxx'</script>";

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网