简体   繁体   English

如何使用javascript按钮预填充Facebook评论框其他社交评论框

[英]How to pre-populate Facebook Comment box other social comment box using a javascript button

I have designed a text decorator for use on social networks. 我设计了一种在社交网络上使用的文本装饰器。 Since the text is generated to a text box and should be shared on social sites, I need to enable mobile phone users to copy-paste the decorated text into a social comment box by just clicking one button. 由于文本是生成到文本框中的,应该在社交网站上共享,因此我需要使移动电话用户只需单击一个按钮,即可将装饰后的文本复制粘贴到社交评论框中。

The challenge is that the fb comment box, or disqus and others are offered in iframes. 面临的挑战是,在iframe中提供了fb评论框或disqus等。 Can someone figure out the correction for my button code? 有人可以找出我的按钮代码的更正吗?

input value="Encool" type="button" class="button" style="width:70%" 
       onclick="window.frames['iframename'].document.getElementById('formname').textareaname.value=    document.getElementById('decoratedtextarea').value;"

Sorry, you can't so that. 抱歉,您不能那样做。 An Iframe served by another domain is inaccessible due to the Same Origin Policy . 由于相同来源策略,无法访问由其他域提供服务的Iframe。 This is to prevent forms of cross-site-scripting attacks. 这是为了防止跨站点脚本攻击的形式。 (which are not dissimilar to what you want to do) (与您想做的没什么不同)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM