views:

27

answers:

2

Hi,

I hace 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 necessarily asking for the code because I realize this might be quite complicated.

The question would be where to start, because I haven´t got a clue!! (when I google cross window or cross domain interaction with javascript I dont really get anything useful).

So any helo I can get, libraries, plugins or whatever might guide me in the right direction is more than appreciated.

Thanks in advance!

Trufa

A: 

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

sputnick
Sorry but I dont see how this helps me? Where should I start with this?
Trufa
+1  A: 

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.

GôTô
That is awesome!! Thank yo so much!! BTW If you can think of any documentation that can come in handy, it would be appreciated, thanks again, great help!
Trufa