JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 1st, 2005, 01:26 PM
craftyfriend craftyfriend is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 7 craftyfriend User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 57 m 40 sec
Reputation Power: 0
access url of imbedded frame page?

I have an iframe which contains two further frames. One of those frames changes. Is there a way, through javascript or any other method, that i can tell from the top level which page has been loaded? I tried location.href, but can only get the url of the frameset that is the iframe, not the pages loaded below it. Any ideas?

Reply With Quote
  #2  
Old June 1st, 2005, 03:51 PM
Kravvitz's Avatar
Kravvitz Kravvitz is offline
CSS & JS/DOM Adept
Dev Shed God 30th Plane (19500 - 19999 posts)
 
Join Date: Jul 2004
Location: USA
Posts: 19,893 Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level) 
Time spent in forums: 6 Months 2 Days 19 h 21 m 49 sec
Reputation Power: 4192
Showing us your code would be helpful.

This link might be helpful.
__________________
Spreading knowledge, one newbie at a time. I'm available for hire at Dynamic Site Solutions.

Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

Remember people spend most of their time on other people's sites (so don't violate web design conventions).

Reply With Quote
  #3  
Old June 1st, 2005, 05:07 PM
craftyfriend craftyfriend is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 7 craftyfriend User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 57 m 40 sec
Reputation Power: 0
Quote:
Originally Posted by Kravvitz
Showing us your code would be helpful.

This link might be helpful.



I have a mainpage "photoindex.html".
On that page I have an iframe:
Code:
<iframe name="gallery" src="galleryframes.html" frameborder="0" width="550" height="720" border="0" scrolling="no" id="gallery"></iframe>


In "galleryframes.html" I have:
Code:
<frameset rows="145, *" frameborder="NO" border="0" framespacing="0">
	<frame name="slide" src="slide.html" scroll="yes">
	<frame name="display" src="display.html">
</frameset>

The page loaded into the frame "display" changes.

I'm trying to write a function from the mainpage, that tells me what page is loaded into the display frame. I believe the problem is that the iframe is considered an object rather than a frame, so i cant access the frames below it.

Right now I have something that looks like
Code:
 <script language="javascript">
<!--
function get_url() {
var frame_url = frames['gallery'].location.href;
return frame_url;
}
-->
</script>

But this only gives me the url of "galleryframes.html" and I can't get it to work with any frame below that.


Thanks for your help
Lauren
Comments on this post
jsKid agrees: thank you for making a serious attempt to solve the problem yourself... it makes a difference to us
all... seriously...

Reply With Quote
  #4  
Old June 1st, 2005, 07:36 PM
Kravvitz's Avatar
Kravvitz Kravvitz is offline
CSS & JS/DOM Adept
Dev Shed God 30th Plane (19500 - 19999 posts)
 
Join Date: Jul 2004
Location: USA
Posts: 19,893 Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level) 
Time spent in forums: 6 Months 2 Days 19 h 21 m 49 sec
Reputation Power: 4192
You almost had it.
You forgot the double slashes in from of the end of the HTML comment.
The language attribute of the script element is deprecated in favor of the type attribute.
Also, there wasn't any reason to make a new variable just so you could return it.
Code:
<script type="text/javascript"><!--
function get_url() {
return frames['gallery'].frames['display'].location.href;
}
// -->
</script>

Firefox, Netscape 6+, IE4+, and Opera 6+ support this.
Comments on this post
jsKid agrees: nifty... if I *ever* used frames.

Last edited by Kravvitz : June 1st, 2005 at 07:38 PM.

Reply With Quote
  #5  
Old June 1st, 2005, 09:49 PM
craftyfriend craftyfriend is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 7 craftyfriend User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 57 m 40 sec
Reputation Power: 0
Thanks for your help.. Unfortunately it doesnt work. I get the error, 'frames.gallery.frames.display.location' is null or is not an object. Here is my page...

http://photofinishstudios.com/photoindex.html

Any more ideas?

Reply With Quote
  #6  
Old June 1st, 2005, 11:30 PM
Kravvitz's Avatar
Kravvitz Kravvitz is offline
CSS & JS/DOM Adept
Dev Shed God 30th Plane (19500 - 19999 posts)
 
Join Date: Jul 2004
Location: USA
Posts: 19,893 Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level) 
Time spent in forums: 6 Months 2 Days 19 h 21 m 49 sec
Reputation Power: 4192
You're calling it with document.write(). You can't do that because that statement will be executed before all of the frames load.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > access url of imbedded frame page?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap