944,157 Members | Top Members by Rank

Ad:
Oct 1st, 2005
0

how do i escape from an iframe?

Expand Post »
i spent a lot of time yesterday redoing my whole website with iframes for each section but once
i put everything onto the server i found that the links inside the iframes opened inside the iframes rather than in the whole window. how do i escape from the iframe to open a link in the whole window or a new window?
i have just left an example iframe page at http://www.fieryidris.co.uk/iframe.htm so the problem can be seen.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
fieryidris is offline Offline
13 posts
since Aug 2005
Oct 1st, 2005
0

Re: how do i escape from an iframe?

Research the "target" attribute of hyperlinks.
Team Colleague
Reputation Points: 227
Solved Threads: 37
Made Her Cry
tgreer is offline Offline
1,697 posts
since Dec 2004
Oct 1st, 2005
0

Re: how do i escape from an iframe?

Should be target="_top"

That's how I fixed my problem like this.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
shephunts is offline Offline
5 posts
since Sep 2005
Oct 3rd, 2005
0

Re: how do i escape from an iframe?

thanks shephunts for target="_top".
i ate some bad fish on saturday and i was already deteriorating when the iframes not doing what i expected finished me off.
i have now done some proper research on the different target commands and checked what happens when you use them in an iframe.

all these links below and the results are within an iframe

<a href="http://www.google.co.uk" target="_blank"> will open google in a new window

<a href="http://www.google.co.uk" target="_parent"> will open google in all of the current window

<a href="http://www.google.co.uk" target="_self"> will open google inside the iframe

<a href="http://www.google.co.uk" target="_top"> will open google in all of the current window

<a href="http://www.google.co.uk"> with no target command will open google inside the iframe

separately from this problem i had of escaping from the iframe i have also been emailed some screenshots by my sister of how the iframe page is being displayed in different browsers and it's not looking very good.
the border of the iframe is only showing on the right hand side and the bottom - i'm not sure if this is because i have got a black background as it seemed to work ok for me in internet explorer and firefox before when the background was red.
in netscape 4.7 the iframe is not displayed at all and the top of the page is just followed by the bottom. i know netscape is now 8.0 so 4.7 is very out of date but is this going to affect any other browsers and destroy the page layout making the iframe a bad idea?

.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
fieryidris is offline Offline
13 posts
since Aug 2005
Dec 19th, 2007
0

Re: how do i escape from an iframe?

Thanks a lot. This thread helps me much.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Pritam1984 is offline Offline
1 posts
since Dec 2007
Dec 23rd, 2007
0

Re: how do i escape from an iframe?

Hadn't used IFRAMEs for a while and forgot about having to use _target. Really messed me up!

Useful reminder.
Reputation Points: 10
Solved Threads: 5
Junior Poster in Training
sourcez is offline Offline
56 posts
since Dec 2007
Jan 16th, 2008
0

Re: how do i escape from an iframe?

Thanks. its useful to solve my problem also.
But instead of click on hyp link i need the same on Image click. Do you have any idea about it.?
Last edited by sbv; Jan 16th, 2008 at 5:42 am.
sbv
Reputation Points: 15
Solved Threads: 8
Junior Poster
sbv is offline Offline
178 posts
since Jan 2008
Jan 17th, 2008
0

Re: how do i escape from an iframe?

simple...
REPLACE:
HTML and CSS Syntax (Toggle Plain Text)
  1. <A href="link.htm">Hyper linked Text</a>
WITH
HTML and CSS Syntax (Toggle Plain Text)
  1. <a href="link.htm">
  2. <IMG SRC="yourimage.jpg" border="0">
  3. </a>
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kiwisites is offline Offline
13 posts
since Oct 2007
Mar 29th, 2011
-1

That was a great solution

seem silly but i have done that before, but it didn't work, perhaps because i was making that call from a java scrip, have any body try that, make the same call from a javascript function?
Reputation Points: 9
Solved Threads: 0
Newbie Poster
mianovag is offline Offline
1 posts
since Mar 2011

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: a 100% width div
Next Thread in HTML and CSS Forum Timeline: Table layout help





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC