-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
can someone explain the correct way to insert adsense js code in zul pages in order to load adsense fast?
i use this code
<html style="margin:0 0 5px 0;padding:0;"><![CDATA[
<script type="text/javascript"><!--
google_ad_client =.......;
/* middle-listings */
google_ad_slot =.......;
google_ad_width =.......;
google_ad_height=.......;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
]]></html>
In Firefox and Explorer adsense are diplayed but loading time is slow; in Chrome sometimes no ads are displayed....
Thanks in advance
Hi RichardL,
if i use the zk component Script, ads aren't displayed; the only way i've found to work correctly is using html component...
Thanks for your reply
Could you show the rest of the zul file? Thanks
the problem is easy to reproduce...The real problem is Chrome: if you repeat page refreshing (3-4 times), the ads are not visible.....
I use Chrome on Ubuntu.
<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window title="new page title" border="normal">
New Content Here!
<html style="margin:0;padding:0;"><![CDATA[
<script type="text/javascript"><!--
google_ad_client = ...;
/* listings */
google_ad_slot = ...;
google_ad_width = ...;
google_ad_height = ...;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br/>
<br/>
]]></html>
</window>
</zk>
Thanks
I don't know if this will work because I don't use adsense, but you could give it a try:
<zk xmlns:c="client"> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"/> <window title="new page title" border="normal"> New Content Here! <script type="text/javascript"> zk.afterMount(function() { google_ad_client = ...; /* listings */ google_ad_slot = ...; google_ad_width = ...; google_ad_height = ...; }); </script> </window>
Asked: 2012-01-27 23:09:07 +0800
Seen: 245 times
Last updated: Jan 30 '12