简体   繁体   中英

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. 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 . This is to prevent forms of cross-site-scripting attacks. (which are not dissimilar to what you want to do)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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