Javascript cross window interaction

后端 未结 3 1402
执笔经年
执笔经年 2021-01-15 20:20

I have this very simple Javascript to write on a text area when the link is clicked:




        
相关标签:
3条回答
  • 2021-01-15 20:40

    Probably it's too late, but here is an example of interaction: window interaction

    0 讨论(0)
  • 2021-01-15 20:41

    Take a look to greasemonkey, it's an addon for your browser. You can choose on which page(s) the script will works.

    http://wiki.greasespot.net/Main_Page

    0 讨论(0)
  • 2021-01-15 20:42

    Ok, I wrote you a sample you can check at http://jsfiddle.net/zzdAL/

    $(document).ready(function()
                      {
                          popup = window.open("http://fiddle.jshell.net");
                          $("#input1").click(function() {
                              try {
                                    popup.document.window.alert(1);
                              }
                              catch (e) { alert(e.message); }
                          });
                      }
                     );
    

    It only runs an alert on the popup, but you can do whatever you want with the popup, assuming you have the necessary rights (needs to be the same domain I believe).

    The most simple is to write a function in your popup and call it from the opener.

    0 讨论(0)
提交回复
热议问题