|
-
Oct 2nd, 2004, 03:32 PM
#1
Thread Starter
Member
Returning the URL of a frame
I have made a frameset page, which consists of three frames. Two of the frames are for navigation/menu, and the third (min) frame is the one that changes according to what's selected in the menu frames.
What I'm trying to do is this: On one of the menu frames, display the URL of the main frame. So each time the main frame changes, it's URL is displayed in a separate frame. I know about the document.URL function which returns the URL of the local frame, but I need to return the URL of a remote frame. (The pages shown on the main frame cannot be altered to pass any value to the calling frames, because they're produced by a third party).
Thanks.
-
Oct 2nd, 2004, 04:37 PM
#2
Frenzied Member
There are a few ways to do this. You could run a function every second or so which checks the url of the main frame. Or else you could change all links to automatically change that text as well as load the page when they are pressed. The first one is probably simpler to implement. Now, since I hate frames I've forgotten how to do this, but here's what I'd try first:
Code:
url = parent.mainFrame.document.location.href
document.getElementById('IDOfMySpan').innerHTML = "<p>"+ur+"</p>"l
Have I helped you? Please Rate my posts. 
-
Oct 3rd, 2004, 02:43 AM
#3
Thread Starter
Member
Unfortunately, the url = parent.mainFrame.document.location.href syntax doesn't work. I get "Access is denied" error on that line.
-
Oct 3rd, 2004, 04:42 AM
#4
Frenzied Member
aaa. I think that is because the page is outside your domain. Try something like parent.mainFrame.src. but if that doesn't wok either, then you might have to change all your links?
Have I helped you? Please Rate my posts. 
-
Oct 3rd, 2004, 03:36 PM
#5
Thread Starter
Member
Almost getting there, using:
url = parent.mainFrame.src
But when I put "url" in an alert function, ie alert(url), the messagebox says "undefined" as the url value.
-
Oct 3rd, 2004, 04:47 PM
#6
Frenzied Member
that does not mean you're close. I can't remember how to do this, and I can't be bothered to find out what it is.
You can either wait for someone else to reply, or google for it, I'd do both.
Have I helped you? Please Rate my posts. 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|