Click to See Complete Forum and Search --> : Object referencing


Atom290
12-04-2002, 10:47 AM
Is there a method of naming a document?

ie. var objDoc=document("Main")

It would be very useful

gil davis
12-04-2002, 12:20 PM
I don't think I see the usefulness. The document object is always available to you. There is only one document in a window/frame/iframe/layer.

It is useful to name a window if it is to be used as a target of a link, or to establish a pointer referencing an existing window.

Charles
12-04-2002, 01:02 PM
In JavaScript and in theory you can always assign an object to a property or variable if yo think that it will save you some trouble:

d = window.document
d.write('foo')

biwols
12-04-2002, 02:40 PM
Use a frame set to open a full window then use the name of the frame as a targetlike this.....
<html>...

<frameset cols="100%" FRAMEBORDER=0 FRAMESPACING=0 BORDER=0>
<frameset rows="100%" FRAMEBORDER=0 FRAMESPACING=0 BORDER=0>

<frame src="/home.htm" NAME="my_home" NORESIZE>

</frameset>
</html>........

.....var objDoc=document("Your URL","my_home","")

biwols
12-04-2002, 02:49 PM
Use a frame set to open a full window then use the name of the frame as a targetlike this.....
<html>...

<frameset cols="100%" FRAMEBORDER=0 FRAMESPACING=0 BORDER=0>
<frameset rows="100%" FRAMEBORDER=0 FRAMESPACING=0 BORDER=0>

<frame src="/home.htm" NAME="my_home" NORESIZE>

</frameset>
</html>........

.....var objDoc=document("Your URL","my_home","")