Referencing <DIV> from another window 
Author Message
 Referencing <DIV> from another window

Hi!

Hope someone can help me out here.

Using VBScript, I'm trying to change the innerHTML code of a div tag from
another window.

I open WindowB from WindowA like this:

dim winWindow
set winWindow = window.open("WindowB.asp","WindowB","",true)

WindowB has the following:

<DIV id=divTest>&nbsp;</DIV>

Then later on in WindowA, I try to change WindowB's divTest.innerHTML
property like this:

winWindow.document.all.divPreview.innerHTML = "This is a test."

This does not work, however. I get a "Object does not support this property
or method" error.

Any suggestions?

Thanks!
Michael

(Remove "nospam" from my email address, if replying)



Sun, 23 Feb 2003 01:12:18 GMT  
 Referencing <DIV> from another window
Try
winWindow.document.all.formx.divPreview.innerHTML = "This is a test."
or
winWindow.formx.divPreview.innerHTML = "This is a test."


Quote:
> Hi!

> Hope someone can help me out here.

> Using VBScript, I'm trying to change the innerHTML code of a div tag from
> another window.

> I open WindowB from WindowA like this:

> dim winWindow
> set winWindow = window.open("WindowB.asp","WindowB","",true)

> WindowB has the following:

> <DIV id=divTest>&nbsp;</DIV>

> Then later on in WindowA, I try to change WindowB's divTest.innerHTML
> property like this:

> winWindow.document.all.divPreview.innerHTML = "This is a test."

> This does not work, however. I get a "Object does not support this
property
> or method" error.

> Any suggestions?

> Thanks!
> Michael

> (Remove "nospam" from my email address, if replying)



Sun, 23 Feb 2003 04:34:36 GMT  
 Referencing <DIV> from another window

Hey Scott:

It still doesn't help.  I'm assuming the formx is a form in the window...?
I tried placing a form called formx around the div tag like:

<FORM name=formx id=formx>
<DIV id=divTest name=divTest>&nbsp;</DIV>
</FORM>

But that didn't do it either.

And a correction:  From WindowA, the line that should be changing the
innerHTML of the div tag is actually:

winWindow.document.all.divTest.innerHTML = "This is a test."

and not what I wrote before.

Any other suggestions?

Michael


Quote:
> Try
> winWindow.document.all.formx.divPreview.innerHTML = "This is a test."
> or
> winWindow.formx.divPreview.innerHTML = "This is a test."



> > Hi!

> > Hope someone can help me out here.

> > Using VBScript, I'm trying to change the innerHTML code of a div tag
from
> > another window.

> > I open WindowB from WindowA like this:

> > dim winWindow
> > set winWindow = window.open("WindowB.asp","WindowB","",true)

> > WindowB has the following:

> > <DIV id=divTest>&nbsp;</DIV>

> > Then later on in WindowA, I try to change WindowB's divTest.innerHTML
> > property like this:

> > winWindow.document.all.divPreview.innerHTML = "This is a test."

> > This does not work, however. I get a "Object does not support this
> property
> > or method" error.

> > Any suggestions?

> > Thanks!
> > Michael

> > (Remove "nospam" from my email address, if replying)



Sun, 23 Feb 2003 04:50:14 GMT  
 Referencing <DIV> from another window
I believe you are the one who emailed me and you have it working now.


Quote:
> Hey Scott:

> It still doesn't help.  I'm assuming the formx is a form in the window...?
> I tried placing a form called formx around the div tag like:

> <FORM name=formx id=formx>
> <DIV id=divTest name=divTest>&nbsp;</DIV>
> </FORM>

> But that didn't do it either.

> And a correction:  From WindowA, the line that should be changing the
> innerHTML of the div tag is actually:

> winWindow.document.all.divTest.innerHTML = "This is a test."

> and not what I wrote before.

> Any other suggestions?

> Michael



> > Try
> > winWindow.document.all.formx.divPreview.innerHTML = "This is a test."
> > or
> > winWindow.formx.divPreview.innerHTML = "This is a test."



> > > Hi!

> > > Hope someone can help me out here.

> > > Using VBScript, I'm trying to change the innerHTML code of a div tag
> from
> > > another window.

> > > I open WindowB from WindowA like this:

> > > dim winWindow
> > > set winWindow = window.open("WindowB.asp","WindowB","",true)

> > > WindowB has the following:

> > > <DIV id=divTest>&nbsp;</DIV>

> > > Then later on in WindowA, I try to change WindowB's divTest.innerHTML
> > > property like this:

> > > winWindow.document.all.divPreview.innerHTML = "This is a test."

> > > This does not work, however. I get a "Object does not support this
> > property
> > > or method" error.

> > > Any suggestions?

> > > Thanks!
> > > Michael

> > > (Remove "nospam" from my email address, if replying)



Sun, 23 Feb 2003 07:12:04 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. --------<<<<<<MONEY>>>>>>--------- id 9543

2. <<<<<<<<ComboBox>>>>>>>>>>>>

3. HELP >>>>>>WIN API <<<<<<<<<<

4. <<<`<<Is SQL SERVER supplied with Windows NT???>>>>>

5. help me out please!!!!<<<<<<<<<<<<<<<<<<<<<<<thanks>>>>>>>>>>>>>>>>>>>>>>>>

6. <><><>HELP<><><> PCMCIA Motorola Montana 33.6

7. <<<<HELP- OLE container Control>>>>>>>>>

8. <<<<Obtaining A ProcessID From An Object Reference>>>>

9. VB5<->RDO2<->ODBC<->ORACLE Procedure Problem

10. <<<Cneck Box>>>

11. <<<Gif Files>>>

12. <<<CD ROM>>>

 

 
Powered by phpBB® Forum Software