1

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 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 don't really get anything useful).

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

3 Answers 3

6

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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!
-1

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

1 Comment

Sorry but I dont see how this helps me? Where should I start with this?
-1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.