0

I am new in Javascript and I would like to learn more on the following scenario.

I have created the following files: 1. start.html 2. destination.html 3. run.js

In run.js, I have included a simple command:

document.write("This is the destination");

In start.html, I called run.js by:

<script language="JavaScript" src="run.js"></script>

This will output the message "This is the destination" to start.html. I would like to find out if there is a way to output the result to destination.html instead of start.html?

Paul
  • 139,544
  • 27
  • 275
  • 264
CCSY
  • 1

1 Answers1

0

May be this is what you are looking for:

 mywindow = window.open("http://{path}/destination.html", "Destination");
 mywindow.document.write('This is the destination');

but be carefull about the pop-up blocker

mooglife
  • 226
  • 1
  • 2
  • 8
  • Further to my question, if I already have a main page with 2 iframes: 1. The content iframe 2. The pagination counter with "previous" and "next" buttons. – CCSY Sep 14 '11 at 08:12
  • Further to my question, if I already have a main page with 2 iframes: 1. The content iframe 2. The pagination counter with "previous" and "next" buttons. I called an external js file for the pagination function in each of the pages to be displayed on the content iframe. It displays the page no. onto the content iframe. Can I output the page no. onto the pagination iframe instead of the content iframe? – CCSY Sep 14 '11 at 08:24
  • I suggest you look into this question: http://stackoverflow.com/questions/997986/write-elements-into-a-child-iframe-using-javascript-or , The idea is that you call the parent window from the content iframe, then select a field in the pagination iframe and fill it with the page number. – Dan Sep 14 '11 at 08:42