新手必看:为什么你不能发贴和回复!
发新话题
打印

google广告的js调用怎么写

google广告的js调用怎么写

下面这样不知道错在哪?
document.writeln("<script type="text/javascript"><!--";
document.writeln("google_ad_client = "******";";
document.writeln("google_ad_width = 468;";
document.writeln("google_ad_height = 60;");
document.writeln("google_ad_format = "468x60_as";");
document.writeln("google_ad_type = "text";");
document.writeln("//channel ");
document.writeln("google_ad_channel = "*****";");
document.writeln("//--></script>");
document.writeln("<script type="text/javascript"");
document.writeln("src="http://pagead2.googlesyndication.com/pagead/show_ads.js">");
document.writeln("</script>");
望指出!或给出个其他的.
document.writeln('<script type="text/javascript"><!--');
document.writeln('google_ad_client = "xxxxxxxxxx";');
document.writeln('google_ad_width = 468;');
document.writeln('google_ad_height = 60;');
document.writeln('google_ad_format = "468x60_as";');
document.writeln('google_ad_type = "text";');
document.writeln('google_ad_channel = "";');
document.writeln('google_color_border = "FFFFFF";');
document.writeln('google_color_bg = "FFFFFF";');
document.writeln('google_color_link = "191919";');
document.writeln('google_color_text = "000000";');
document.writeln('google_color_url = "000000";');
document.writeln('//--></script>');
document.writeln('<script type="text/javascript"');
document.writeln('  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">');
document.writeln('</script>');

括号内不能同时用双引号。
速度好象没有提高.还是和直接用一样慢!
我都是这样调用 
document.write("<div>";
google_ad_client = "";
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = "160x600_as";
google_ad_type = "text_image";
google_ad_channel = "";
document.write("<script type='text/javascript'  src='http://pagead2.googlesyndication.com/pagead/show_ads.js'></script></div>";
比原来快吗?
用js跟速度关系不大,只是对于生成静态的网站来说,方便一些。
引用:
原帖由 yyqfwq 于 2006-11-22 22:28 发表速度好象没有提高.还是和直接用一样慢!
对访问者来说,速度会更慢,但是对网站维护来说,速度不只快一点点。
发新话题