jartalo
09-24-2003, 11:11 AM
Hello,
I'm having problems with frames. I don't know if what I want is possible to do.
It's easy to order a frame a URL to load any url, with this sentence:
top.frames['frm_1'].document.location.href=url
but ¿is it possible to do just the opposite? that is, I have a page with 2 frames, frm_1 and frm_2. In frm_1 there is loaded 1.html, and in frm_2 is loaded, for example, http://www.google.com. Well, now, I don't want to say frm_2 to load anything, but want to know what URL is loaded in frm_2. I've tried this code unsuccessfully:
function anyfunction(){
var urlframe1;
urlframe1=top.frames['frm_2'].document.location.href;
alert(urlframe1);
}
and after: <a href="javascript:anyfunction()">click here to know where you are surfing in the other frame</a>. This code should be in 1.html.
¿Anybody can help me, please?
Thanks, and sorry for my english.
I'm having problems with frames. I don't know if what I want is possible to do.
It's easy to order a frame a URL to load any url, with this sentence:
top.frames['frm_1'].document.location.href=url
but ¿is it possible to do just the opposite? that is, I have a page with 2 frames, frm_1 and frm_2. In frm_1 there is loaded 1.html, and in frm_2 is loaded, for example, http://www.google.com. Well, now, I don't want to say frm_2 to load anything, but want to know what URL is loaded in frm_2. I've tried this code unsuccessfully:
function anyfunction(){
var urlframe1;
urlframe1=top.frames['frm_2'].document.location.href;
alert(urlframe1);
}
and after: <a href="javascript:anyfunction()">click here to know where you are surfing in the other frame</a>. This code should be in 1.html.
¿Anybody can help me, please?
Thanks, and sorry for my english.