我有这样一个 Adsense 代码:
<script type="text/javascript"><!--
google_ad_client = "ca-pub-12345";
/* my advertisement */
google_ad_slot = "2345";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
我有这样一个js文件:
$(document).ready(function() {
var adsenseCode='<script type="text/javascript"><!--
google_ad_client = "ca-pub-12345";
/* my advertisement */
google_ad_slot = "2345";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>';
$().append(adsenseCode);
}
我尝试使用双引号、单引号、删除注释行等。没有找到解决方案。
如何在我的 HTML 页面中打印 javascript 代码?