我的 ASP.Net 应用程序中有一个 ShareThis 小部件,单击它会启动一个弹出窗口,用户可以键入消息,然后与许多服务共享。我想设置一个更有用的与上下文相关的“固定”消息,但我无法让它工作。我的代码和屏幕截图如下。
<div id="ShareDiv"><span class='st_sharethis_large' displayText='ShareThis'></span>
<span id="button_1" class='st_facebook_large' displayText='Facebook'></span>
<span class='st_twitter_large' displayText='Tweet'></span>
<span class='st_googleplus_large' displayText='Google +'></span>
<span class='st_email_large' displayText='Email'></span></div>
<script type="text/javascript"> var switchTo5x = true; </script>
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"> </script>
<script type="text/javascript"> stLight.options({ publisher: "ur-ae96e1f4-e30b-b79b-fb91- 54d133283702" }); </script>
<script>
$(document).ready(function(){
$('#ShareDiv').click(
function(){
$('textarea').val('Some useful canned message');
});
});
</script>
最佳答案
你尝试过这个吗:
只需将参数 st_msg(如果您愿意,还可以添加 st_via)到带有“st_twitter_large”类的 span 标记中。
回复:http://support.sharethis.com/customer/portal/articles/517332
关于javascript - 使用 jQuery 更改 ShareThis 消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12438882/