PDA

View Full Version : problem with frames properties


usban
01-02-2003, 11:30 PM
I'm having a problem with frames and i'm completely astonished. I have this frameset:


<frameset rows="50,*" cols="*" SCROLLING="no" border="0">
<frame src="titulo.html" name="top" SCROLLING="no">

<frameset rows="*" cols="135,* SCROLLING="no">
<frame src="menuv.html" name="menu" SCROLLING="no">
<frame src="centerv.html" name="principal">
</frameset>

</frameset>

As you can see, one horizontal above, and in the one that is under i have two more frames.

Well the problem is that when i call

nombre = window.frames[0].name; ---> i get "top"
nombre = window.frames[1].name; ---> i get "menu"

but when i call

nombre = window.frames[2].name;

i get "No permission"

I don't know why, i have think it around but no idea, it happens with all the properties of this frame.
:mad: PLease help me

piz
01-02-2003, 11:40 PM
I haven't tried it, but try it like this:

nombre = window.frames[1].frames[1].name

you have a frameset in a frameset, so this frameset is another frame.

Or replace window with parent or top.
From which frame do you call this js-code?

Saludo,
piz

usban
01-02-2003, 11:57 PM
If i use what you have said i get the error that this object does not exist but if i use

window.frames.frames.frames.frames[1].name

and all the "frames" that i want i get the right name, but if i try with the frames[2] i continue getting "No permission"

ca_redwards
01-03-2003, 12:05 AM
I believe that this is a security thing. One domain's JavaScript code should not be allowed to modify content produced by another domain.

I have discovered an exception: Build a window or frame entirely from bookmarklet-based JavaScript, and its content will be regarded as having originated from the domain of the originating window. In my HTML() bookmarklet library (http://www.angelfire.com/ca/redwards/html__.calendar.html)'s documentation, the editor example allows text selected on a web page to be edited in a pop-up window.
;)

whammy
01-03-2003, 01:02 AM
This is a security restriction as stated above. For very valid reasons, you can't access pages that are in another domain with javascript.

After all, you wouldn't like it if someone had your page in their frameset and claimed to be the author. :)

If you ARE the author, and the page is in the same domain, perhaps try:

top.framename.whatever