I'd combine <iframe> and the <form>'s ability to be sent even to another domain. Main file:
<iframe id=ifr src=form.html style="display: none;"></iframe> <input id=send-me><input type=button onclick="senddata();" value=Send> <script> function senddata() { var ifr = document.getElementById('ifr'), f = ifr.contentWindow.document.forms[0]; f.elements.data.value = document.getElementById('send-me').value; f.submit(); } </script>
form.html:
<form action="http://another.doma.in/" method=post> <input type=hidden name=data> </form>
This will make POST HTTP request to another domain and send there the content of <input id=send-me>.
Please note that this is just basic proposal and will need adjustment if you want to for example send data multiple times without refresh.