处理<在tw:counturl addthis插件中 [英] Dealing with < in tw:counturl addthis plugin

查看:90
本文介绍了处理<在tw:counturl addthis插件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个addthis插件,用于显示我的Blogspot博客中的推文总数.我用这种方式 如果我提到tw:counturl ="my_specific_blogger_url">,它会显示确切的tweets数量.但是问题在于,在那种情况下,我只能使用一个链接. 要检索特定的博客页面URL,请使用<data:blog.url/>.但是,如果我通过以下方式在tw:counturl中使用它:

I have an addthis plugin for displaying total number of tweets in my blogspot blog. I use it this way If i mention tw:counturl="my_specific_blogger_url" > it shows the exact number of tweets. But the problem is that in that case I can use only one link. To retrieve specific blog page url I use <data:blog.url/>. But if i use it in tw:counturl in the following way:

tw:counturl="<data:blog.url/>"它显示为错误,因为tw:counturl无法处理'<'标签.有没有解决的办法.

tw:counturl="<data:blog.url/>" it shows as an error as tw:counturl cannot handle '<' tag. Is there a work around.

错误如下The value of attribute "tw:counturl" associated with an element type "null" must not contain the '<' character.

推荐答案

好,我找到了答案. 您必须添加一个JavaScript代码来处理它.

Ok I found the answer to it. You have to add a javascript code to handle it.

var tweet_button = document.getElementById(&#39;addthis_button_tweet&#39;);
tweet_button.setAttribute(&#39;tw:counturl&#39;, <data:blog.url/>);

这篇关于处理&lt;在tw:counturl addthis插件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆