DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   HTML and CSS (http://www.daniweb.com/forums/forum143.html)
-   -   how do i escape from an iframe? (http://www.daniweb.com/forums/thread33237.html)

fieryidris Oct 1st, 2005 5:09 pm
how do i escape from an iframe?
 
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.

tgreer Oct 1st, 2005 6:34 pm
Re: how do i escape from an iframe?
 
Research the "target" attribute of hyperlinks.

shephunts Oct 1st, 2005 7:32 pm
Re: how do i escape from an iframe?
 
Should be target="_top"

That's how I fixed my problem like this.

fieryidris Oct 3rd, 2005 11:44 am
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?

.

Pritam1984 Dec 19th, 2007 9:55 am
Re: how do i escape from an iframe?
 
Thanks a lot. This thread helps me much.

sourcez Dec 23rd, 2007 7:14 am
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.

sbv Jan 16th, 2008 5:32 am
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.?

kiwisites Jan 17th, 2008 4:12 pm
Re: how do i escape from an iframe?
 
simple...
REPLACE:
<A href="link.htm">Hyper linked Text</a>
WITH
<a href="link.htm">
<IMG SRC="yourimage.jpg" border="0">
</a>


All times are GMT -4. The time now is 2:33 pm.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC