使用js調用Google Adsense

by admin
2 comments

logo plain現在Google Adsense已經允許使用javascript調用adsense代碼。這樣做的好處是,對於那些生成html文件的程序,將廣告與內容分離之後,我們只要修改js文件就能改變我們的廣告樣式,而不用重新生成html文件。

js調用廣告的方法很簡單,在需要插入廣告的位置,把原有的廣告代碼改為嵌入的代碼,例如:

[code]
[/code]

但是在調用的時候需要進行一些改變:

[code]document.writeln(“ “);
document.writeln(“<\/script> “);
document.writeln(“
document.writeln(“src=\”http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\”> “);
document.writeln(“<\/script>”);
document.writeln(“”)[/code]

You may also like

2 comments

高藥師 2008 年 11 月 28 日 - 3:58 下午

請問這樣做的好處是???

有空到我哪裡來坐坐

Reply
hightfly 2008 年 11 月 29 日 - 4:14 上午

方便修改GG帶碼….

Reply

Leave a Comment

Welcome to SoftBlog, a vibrant community dedicated to empowering developers, tech enthusiasts, and software professionals. Whether you’re a beginner or an experienced coder, we provide the resources, tools, and support you need to thrive in the ever-evolving world of software development.

Privacy Policy © Copyright 2007 – 2022 軟體部落 – 本站採用 Cloudways雲端代管主機

Adblock Detected

Please support us by disabling your AdBlocker extension from your browsers for our website.