我有php和jQuery/Javascript之间的问题......它不会显示或无法工作。PHP/jQuery未捕获SyntaxError:意外的令牌非法
我的代码:
if($bottom_1_banner == "true"){
//$data_AD .= '$(\'.ban_bottom\').html(\''.htmlentities($bottom_banner).'\').text();';
$data_AD .= '$(\'.ban_bottom\').html("'.htmlspecialchars($bottom_banner).'").text();';
}
错误日志:(铬/ Safari浏览器)
<script type="text/javascript">
$(document).ready(function() {
$('.ban_bottom').html("<!-- xxxxxxx -->
******index.php:11 Uncaught SyntaxError: Unexpected token ILLEGAL******
<script type="text/javascript">
xxxxxxx_bid = "xxxxxxxxxxx";
</script>
<script type="text/javascript" src="http://xxx.xxxxxx.com/k.js"></script>
<!-- xxxxxxxx -->").text(); });
</script>
OR
编辑:转换后的图像为文本。根据您的代码
删除htmlentities并可能使用addslashes ... –
这很难阅读。你可以发布代码而不是代码的隐藏图片吗? – David
您可能需要告诉htmlentities使用UTF8编码。 – Treffynnon