How to Minify Google AdSense JS?

萝らか妹 提交于 2019-12-06 15:14:40

The problem is the HTML comment tags at the start and end of the first script tag. You don't need them, they're just there to work around Netscape 1.0

Try replacing your minified script with this

<script type="text/javascript">google_ad_client="xxx";google_ad_slot="2668798369";google_ad_width=160;google_ad_height=600;</script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js">

i think you left out this part:

//-->

Try to remove the <!--

Hope it helps

It'll be the <!-- - this can mean 'treat this line as a comment'. It's an old compatibility hack for browers that didn't support JavaScript.

Either remove it or add a linebreak afterwards, i.e.

<script type="text/javascript"><!--
google_ad_client="xxx"; ...

though I can't see what minifying here is gaining you - there's nothing that can be renamed or compressed.

Luke

Look out for this:

<!-- and -->

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!