cross-window-scripting

window.postMessage - difficulties to make it work

纵然是瞬间 提交于 2019-12-08 12:18:56
问题 I try to establish communication from PayPal Ipn.php script (when "Completed" message is received - that part is tested and works well), and the original page of Form that contains a submit button. The idea is to have the submit button clicked. The 2 pages are on same domain using the same protocol. Here is my script on Ipn.php script: $click = "<script> window.postMessage('Completed', 'http://www.example.com'); </script>"; echo $click; echo "test"; // I receive it. After further testing the

Javascript cross window interaction

蹲街弑〆低调 提交于 2019-12-01 12:36:33
I have this very simple Javascript to write on a text area when the link is clicked: <head> <script language="javascript" type="text/javascript"> function addtext(text) {document.form.textarea.value = document.form.textarea.value+= text;} </script> </head> <body> <form action="" method="" name="form"> <textarea name="textarea" rows="" cols="" wrap="wrap"></textarea> </form> <a href="javascript:addtext('q');">q</a> </body> Now I want to up the ante. What I want to do is have the form in another another window, and that when I click the link, I writes to a textarea in another window. I'm not

Sending a message to all open windows/tabs using JavaScript [duplicate]

旧巷老猫 提交于 2019-11-27 13:34:08
This question already has an answer here: Communication between tabs or windows 9 answers I hear HTML5 has window.postMessage() , but it seems to require having a handle on the window (or tab, throughout this question) you're posting the message to. What if I want to broadcast to all open windows? Is this possible? (What I'm trying to do is warn other windows without any server round-trips when a user does something in one window that affects the others, so that they can update their content. However, while some windows may be opened from existing ones--allowing me to intercept and store

Sending a message to all open windows/tabs using JavaScript [duplicate]

主宰稳场 提交于 2019-11-26 18:18:54
问题 This question already has an answer here: Communication between tabs or windows 9 answers I hear HTML5 has window.postMessage() , but it seems to require having a handle on the window (or tab, throughout this question) you're posting the message to. What if I want to broadcast to all open windows? Is this possible? (What I'm trying to do is warn other windows without any server round-trips when a user does something in one window that affects the others, so that they can update their content.