javascript - how to share a url with # in twitter using tweet_button.html -
i have twitter img onclick function tweetpage
<img src="images/twtr.png" onclick="tweetpage();"/>
function tweetpage() { var url = "http://www.website.com/index.html#eyjkijoidghpcybpcybh"; var testurl ="https://platform.twitter.com/widgets/tweet_button.html?url="+url var htmlstr = '<iframe allowtransparency="true" frameborder="0" scrolling="no"' +'src="'+testurl+'"' +'style="width:130px; height:20px;padding-top: 37%;"></iframe>' $('#twitlinddiv').html(htmlstr); } and tweetbutton shown. clicking on tweet button twitter popup box shown url in textbox contains only
how can solve this.
i tried
&hashtags= instead of #
the result was
http://www.website.com/index.html #eyjkijoidghpcybpcybh
how can solve this
tweetid div inner html added (this works fine me.)
var referenceurl = window.location.tostring(); var shareurl = 'http://www.website.com/index.html#eyjkijoidghpcybpcybh' $('#tweetid').html('<iframe allowtransparency="true" frameborder="0" scrolling="no" src="http://platform.twitter.com/widgets/tweet_button.1368146021.html#_=1369640770351& count=none& id=twitter-widget-0& lang=en&original_referer=' +encodeuricomponent(referenceurl) +'&related=nothing%20to%20worry&size=m& text=liveimpact& url='+encodeuricomponent(shareurl) +'" class="twitter-share-button twitter-count-none" title="twitter tweet button" data-twttr-rendered="true" style="width: 56px; height: 20px;">' +'</iframe>');
Comments
Post a Comment