当尝试使用 jquery 将元素的 html 属性设置为 google trend embed 时,我收到错误。
<!DOCTYPE html>
<html>
<head>
<title>Titlw</title>
</head>
<body>
<div class="hide" id="google_trends"></div>
</body>
<script type="text/javascript">
/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */
</script>
</html>
<?php
echo "
<script>
$('#google_trends').removeClass('hide');
$('#google_trends').html('<script type=\"text/javascript\" src=\"https://ssl.gstatic.com/trends_nrtr/2213_RC01/embed_loader.js\"></script> <script type=\"text/javascript\"> trends.embed.renderExploreWidget(\"TIMESERIES\", {\"comparisonItem\":[{\"keyword\":\"a\",\"geo\":\"\",\"time\":\"today 5-y\"}],\"category\":0,\"property\":\"froogle\"}, {\"exploreQuery\":\"date=today%205-y&gprop=froogle&q='a'\",\"guestPath\":\"https://trends.google.com:443/trends/embed/\"});</script>');
</script>";
?>
错误消息-
“未捕获的语法错误:无效或意外的标记”
隔江千里