Trick to Add AdSense, AdBrite and Other JavaScript Ad Code Directly to Blogger HTML Template伎俩AdSense新增, adbrite和其他JavaScript广告代码直接到Blogger HTML模板
Advanced users of Blogger.com service may have tried to insert and put Google AdSense ad code which is actually a Java script directly into the blog pages by manually editing the XML-based template HTML coding interface.进阶使用者的blogger.com服务可能曾尝试插入和提出的Google AdSense广告代码,这其实是一个Java脚本直接进入博客页面通过手动编辑基于XML的模板HTML编码接口。 Actually, it’s possible add any ad code by using HTML/JavaScript page element within the Blogger new XML template system, but the place where you can place the new block is rather limited, ie above or below the post body, header, footer, within sidebar or实际上,它可能添加任何广告代码使用HTML / JavaScript网页元素的Blogger新的XML模板系统,但在这里,您可以把新大楼是相当有限,即上面或下面的帖子正文,页眉,页脚,在工具栏或 between blog posts之间的博客帖子 . 。 In case you want to put the ads inside the post, or align the ads to float and wrap around the text, or just within the single individual article content view, you will have to edit directly the HTML coding of Blogger template.在情况下,您想提出的广告内的职位,或使广告浮法和捆绕的案文,或只在单一的个别文章内容的看法,你将不得不直接编辑的HTML编码Blogger模板。
If you try to insert any Google AdSense, AdBrite, AdEngage and any other JavaScript based ad code, or client-side components such as counter, tracker, form, snippet, effect, date and time, etc which is JavaScript based, the following error message may be returned when saving ore previewing:如果您尝试插入任何的Google AdSense , adbrite , adengage和任何其他基于JavaScript的广告代码,或客户端组件,如反,盈富,形式,片段内容,效果,日期和时间等,这是基于JavaScript的,下面的错误消息可能会返回时,节省矿预览:
Your template could not be parsed as it is not well-formed.您的模板无法解析,因为这是不完整。 Please make sure all XML elements are closed properly.请确定所有的XML元素均已正确关闭。 XML error message: The processing instruction target matching “[xX][mM][lL]” is not allowed. XML错误讯息:处理指令目标匹配“第[ XX ] [毫米] [ 11 ] ”是不允许的。
or或
Your template could not be parsed as it is not well-formed.您的模板无法解析,因为这是不完整。 Please make sure all XML elements are closed properly.请确定所有的XML元素均已正确关闭。
XML error message: The reference to entity “zs” must end with the ‘;’ delimiter. XML错误讯息:参考实体“ zs ”必须结束与' ; '定界符。
and many other different XML error message.和许多其他不同的XML错误讯息。
The problem is caused by incorrect dynamic interpretation of Blogger XML template when it generates the HTML webpage for the blog page that is requested, probably due to the fact that the AdSense ad code or other code is not a valid XML, coupled with the fact that some ASCII characters have special meaning and reserved functions, confusing Blogger blogging engin.问题是,所造成的不正确动态释义的Blogger XML模板时,它生成的HTML网页为博客页面是要求,可能是由于这一事实,即AdSense广告代码或其他代码,是不是一个有效的XML ,再加上这一事实一些ASCII字符有特殊的意义,并保留职能,混乱的Blogger博客搜索引擎。
The resolution to the JavaScript based coding does not work in Blogger HTML template error can be solved by replacing special characters or symbols in the script to HTML code.该决议的JavaScript基于编码不工作在Blogger HTML模板的错误是可以解决的取代的特殊字符或符号,在脚本的HTML代码。 Check out the list below for which ASCII characters that need to be replaced with their corresponding HTML code.检查下面的列表,其中ASCII字符表示,需要更换其相应的HTML代码。 Using HTML code will ensure that Blogger render the character correctly when serving the page to the viewer.使用HTML代码将确保提供的Blogger的性质,正确提供服务时的网页查看。
< - < < -<
> - > > -> “
Above two is enough to make Google AdSense works in Blogger template.上述两项足以使Google AdSense的工程在Blogger模板。 For other scripts, such as AdBrite ad code, you will need to replace more characters such as those listed below.其他脚本,如adbrite广告代码,您将需要更换更多的字符,如那些列在了下面。
& = & & = &
” = " “ = ”
For example, a Google AdSense code should become looks similar to code below:举例来说,一个Google AdSense代码应该成为看起来类似下面的代码:
<script type="text/javascript"><!-- <script type="text/javascript"> < ! -
google_ad_client = "pub-XXXXXXXXXXXXXXX"; google_ad_client = “酒吧xxxxxxxxxxxxxxx ” ;
google_ad_width = 336; google_ad_width = 336 ;
google_ad_height = 280; google_ad_height = 280 ;
google_ad_format = "336x280_as"; google_ad_format = “ 336x280_as ” ;
google_ad_type = "text_image"; google_ad_type = “文字_ ” ;
google_ad_channel = ""; google_ad_channel = “ ” ;
google_color_border = "FFFFFF"; google_color_border = “ ffffff ” ;
google_color_bg = "FFFFFF"; google_color_bg = “ ffffff ” ;
google_color_link = "000000"; google_color_link = “ 000000 ” ;
google_color_text = "000000"; google_color_text = “ 000000 ” ;
google_color_url = "000000"; google_color_url = “ 000000 ” ;
//--></script> //--></脚本>
<script type="text/javascript" <脚本类型= “文本/ JavaScript的”
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> 钢骨混凝土= “ http://pagead2.googlesyndication.com/pagead/show_ads.js ” >
</script> < /脚本>
While an AdBrite ad code will became the similar code to the below:而一adbrite广告代码将成为类似的代码向如下:
<script type="text/javascript"> <script type="text/javascript">
var AdBrite_Title_Color = '0000FF'; 无功adbrite_title_color = '0000ff ' ;
var AdBrite_Text_Color = '000000'; 无功adbrite_text_color = '000000 ' ;
var AdBrite_Background_Color = 'FFFFFF'; 无功adbrite_background_color = ' ffffff ' ;
var AdBrite_Border_Color = 'FFFFFF'; 无功adbrite_border_color = ' ffffff ' ;
</script> < /脚本>
<script src="http://ads.adbrite.com/mb/text_group.php?sid=303771&zs=3330305f323530" type="text/javascript"></script> <script src="http://ads.adbrite.com/mb/text_group.php?sid=303771&zs=3330305f323530" type="text/javascript"> < /脚本>
<div><a target="_top" href="http://www.adbrite.com/mb/commerce/purchase_form.php?opid=303771&afsid=1" style="font-weight:bold;font-family:Arial;font-size:13px;">Your Ad Here</a></div> <div> <一个目标= “ _top ” href = “ http://www.adbrite.com/mb/commerce/purchase_form.php?opid=303771&afsid=1 ”风格= “字型粗细:大胆;字型家庭: Arial字型;字型大小: 13px “ >您的广告在这里< /一> < /学>
Simply use the text editor to parse the code and then replace the characters.只需使用文本编辑器解析代码,然后替换字符。 Don’t worry about violating AdSense TOS or other terms and conditions, as once the blog’s web pages are rendered and presented to the viewers and visitors, the code will be exactly same as the original code before any replacement!不必担心违反AdSense的服务条款或其他条款及条件,一旦博客的网页呈现,并提交给观众和游客,代码将完全一样的原始代码之前,任何更换!
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要说明 :这是一个机器翻译网页是“按原样”提供的担保。 Machine translation may be difficult to understand.机器翻译可能很难理解。 Please refer to请参阅 original English article原来的英语文章 whenever possible.只要有可能。
Share and contribute or get technical support and help at分享和贡献,或取得技术的支持和帮助,在 My Digital Life Forums 我的数字生活论坛 . 。
Related Articles相关文章
- Place AdSense Ad Unit In Various Positions Inside Within Blogger Post Contents地方AdSense广告单元在各个据点内的Blogger帖子内容
- How to Display Elements (Ads) Only On (Or Only Not At) Individual Single Post Item View如何显示元素(广告) ,只(或只有不)个别单一邮政项目的看法
- How to Wrap AdSense Ads Around and Inline Beside Blogger Post Content如何总结AdSense广告约和内置旁边的Blogger帖子内容
- Workaround to Add Custom Channels into Blogger AdSense Page Element Widget其他可行方案如果要添加自定义渠道到Blogger AdSense的网页元素的小装置
- Move Blogger Inline Ads Between Posts to Inside Within Post Position动议的Blogger内插广告之间的员额内后的立场
- Add and Put AdSense Ads Code and JavaScript to Google Page Creator Website新增和提出的AdSense广告代码和JavaScript到Google Page Creator网站
- google_ad_host Host ID in Google AdSense Ad Unit Code and Revenue Sharing google_ad_host主机ID在Google AdSense广告单元代码和收益分享
- Add and Insert to Put Google AdSense Ads Units Between Blog Posts in Blogger.com新增和插入把Google AdSense广告单位之间的博客帖子在blogger.com
- Integrate and Display Google AdSense for Search and Co-Op Custom Search Engine Results in WordPress Blog Page Template整合和展示Google AdSense for search的和合作的作品自定义搜索引擎结果在WordPress博客页面模板
- Using Invisible Counter with Official StatCounter Plugin for WordPress用无形的柜台正式statcounter插件的WordPress

































August 23rd, 2008 14:18 2008年8月23日14时18分
Thanks for great tips.I am not sure about what you said for violation of adsense TOS.Are you sure its ok?感谢伟大的tips.i时,不知道你说的对违反AdSense的tos.are您确定其确定?
August 8th, 2008 00:47 2008年8月8日0时47分
thanks..感谢.. was stuck with adbrite code…是坚持与adbrite代码…
May 28th, 2008 11:08 2008年5月28日11时08分
[...] adsense code in greater clarity, explaining the need of why this change needs to be done. [ … … ] AdSense代码在更为清晰,解释的需要,为什么这种变化需要做的事情。 Read this article (link) for more details: If you try to insert any Google AdSense, AdBrite, AdEngage and any other JavaScript based ad [...]阅读此文章(链接)了解详情:如果您尝试插入任何的Google AdSense , adbrite , adengage和任何其他基于JavaScript的广告[ … … ]