Click to See Complete Forum and Search --> : share an object variable


kevin
08-22-2000, 05:21 PM
There are two questions:

The first one is that I have a script in one html which contains a local
variable type of object. and I want my another page be able to access it.
I need you guys help me with this. Thank you!

The second one is that I have script looks like this:
newWin = window.open('',"name",'')
newWin.document.write("<html><body>" + aaa.innerHTML + "</body></html>")

in the "Page1.htm", however if I want to save this html, I want to be able
to save the whatever the document.write's content. Not the actual content
of Page1.htm. How can I do that? Thank you so much!

kevin

Max Davidse
08-25-2000, 02:16 AM
"kevin" <kevinou@hotmail.com> wrote:
>
>There are two questions:
>
>The first one is that I have a script in one html which contains a local
>variable type of object. and I want my another page be able to access it.
>I need you guys help me with this. Thank you!
>
>The second one is that I have script looks like this:
> newWin = window.open('',"name",'')
> newWin.document.write("<html><body>" + aaa.innerHTML + "</body></html>")
>
>in the "Page1.htm", however if I want to save this html, I want to be able
>to save the whatever the document.write's content. Not the actual content
>of Page1.htm. How can I do that? Thank you so much!
>
>kevin

Your first question I don't completely understand, but since you can access
all sorts of functions that are in other frames, why not variables....just
play around with it a bit...

For the second question, the answer is an easy one, you can't! None of the
browsers pastes the result of your javascript, if this was an ASP page and
you would response.write all stuff, then you could.

Max Davidse
Programmer @ Doublespace Europe
http://www.doublespace-eu.com
mdavidse@doublespace-eu.com

----------------------------------------
"Distance is not important,
it's the first step that is the hardest"
----------------------------------------

Amar
11-17-2000, 10:43 PM
>>variable type of object. and I want my another page be able to access it.

use the "opener" property that gets set when you open a new window

something like var x = top.opener.myvar