PDA

View Full Version : <IFRAME> question



Lucky13
July 31st, 2001, 09:21
If you have a link in an <IFRAME> that is linked to a bookmark (or anchor, whatever) on the page that the <IFRAME> is on, how can I make the link just go to the bookmark, instead of having to reload the page?

Thanks
~Lucky13

niv
July 31st, 2001, 09:27
:confused:

re-organize your thoughts please ;)

Lucky13
July 31st, 2001, 09:55
eh...sorry...I was in a hurry to write that last one...I had other things on my mind. Try this:

index.html
--------------------------------------------
<HTML>
<HEAD...blah blah blah>
<BODY>
hello
<IFRAME SRC="page1.html">
<A NAME="bookmark"> la la la la la la
</HTML>
--------------------------------------------

OK...say that there's a link in page1.html that points to index.html#bookmark. Without any "doctoring" clicking on the link in the frame will make index.html completely reload and then go to the anchor. I want to know how to do it WITHOUT having to reload index.html. Is there any way to do this?

Thanks a lot.
~Lucky13

niv
July 31st, 2001, 10:29
i think you can use _top as the TARGET, try that, it might just work.

meow
July 31st, 2001, 10:31
Re-organize again. Completely reload without reloading? :)

Lucky13
July 31st, 2001, 10:41
I tried _top...it didn't work.

Meow, try this:

page page page page page page page page page page
page page page page +---------------------------------------+
page page page page |frame frame frame frame frame |
page page page page |frame frame frame link frame |
page page page page |frame frame frame frame frame |
page page page page |frame frame frame frame frame |
page page page page |frame frame frame frame frame |
page page page page |frame frame frame frame frame |
page page page page +---------------------------------------+
page page page page page page page page page page
page page bookmark page page page page page page
page page page page page page page page page page

I want the link in the "frame" to go to the bookmark in the "page" without having to reload the "page". I want it to literally treat it like a bookmark, INSTEAD of a link.
To put it another way, I want it to act like the link is in "page"...almost like there is no "frame" at all.

there how's that? :)

~Lucky13

niv
July 31st, 2001, 10:42
right now, i'm thinking why use IFRAME when you can use PHP includes

Lucky13
July 31st, 2001, 10:45
I have a control panel think going on...a member signs in there, and the only page that changes is the one that's in the little frame. I did that so that they could stay on the main page and still check their private messages, take care of account maintenance, etc.

lucifer
July 31st, 2001, 10:53
can't you use

parent.location or something of that ilk?

Lucky13
July 31st, 2001, 10:55
I'm not familiar with that...could you elaborate?

meow
July 31st, 2001, 10:58
:confused: :confused: :confused: :confused: :confused:
How would this or anything happen without reloading the page? Buhuuuuhuu! I don't understand what you want to do!:mad:

lucifer
July 31st, 2001, 11:02
<A href="javascript:parent.location.href='page.html#bookmark'">go there</A>

niv
July 31st, 2001, 11:07
Originally posted by lucifer
<A href="javascript:parent.location.href='page.html#bookmark'">go there</A>

<A HREF="javascript:parent.location.href='page.html#bookmark'">go there</A>

:p

meow
July 31st, 2001, 11:16
Without the main page reloading? What do I miss here?:confused:

lucifer
July 31st, 2001, 12:10
it be magic :p

meow
July 31st, 2001, 12:22
BS. It reloads. :rolleyes:

Lucky13
July 31st, 2001, 13:23
Meow...if you are at the page index.html, and you click on a link that goes to index.html#bookmark, the page doesn't reload...it just moves you....that's what I mean. Thanks a lot Lucifer...I'll try that out when I get back...but I have to leave right now.


~Lucky13

meow
July 31st, 2001, 13:28
Sure? I thought it reloaded when you did that. I must look closer.

LastActionHero
August 1st, 2001, 04:05
Originally posted by meow
Sure? I thought it reloaded when you did that. I must look closer.
No it doesn't reload.

Haven't u seen the FAQ pages? Where u click on "go to top" . it doensn't reload does it?

meow
August 1st, 2001, 07:40
Yes, but I thought it would since focus shifts to another document. I've realized I was wrong. Don't bash me, bully! :mad:
Besides I detest JavaScript. :p

Lucky13
August 1st, 2001, 11:40
well that javascript thing didn't work....it tried to make me download the bookmark (which obviously didn't work :) ). Do you have any other tricks up your sleeve?

LastActionHero
August 1st, 2001, 11:45
I always wear a sleevless shirt :p

Lucky13
August 1st, 2001, 11:47
Well you're no help....do you have any ideas Lucifer?

meow
August 1st, 2001, 11:51
How could lah help? He is a sleevless shirt! :p

LastActionHero
August 1st, 2001, 11:55
What are you talking about meow I don't see anything ;)

lucifer
August 1st, 2001, 15:14
this works for me


in your main page (main.html)

<a name="bookmark"></a>

in your iframe

<a href="#" onclick="parent.location.href='main.html#bookmark';return(false);">link</a>


meow, stay off them drugs :p

meow
August 1st, 2001, 15:33
Last edited by lastactionhero on 08-01-2001 at 12:54 PM :rolleyes:

Lucky13
August 1st, 2001, 18:04
OK, Lucifer...that worked great, but now it gives me an error that says there are illegal characters...any MORE ideas? :)

niv
August 1st, 2001, 18:08
try:



<a href="#" onclick="parent.location.href='main.html#bookmark';return false;">link</a>

Lucky13
August 1st, 2001, 18:18
nope...that didn't work either...

lucifer
August 1st, 2001, 18:29
that works no probs on my pc - no errors.

have you got anything else on your page?

what browser?

IE 4.0 is fine (I'm still mid re-install)

Lucky13
August 1st, 2001, 18:49
well, it's in PHP, but I tried taking the link out of PHP (by closing the PHP tags around it) and that didn't work. And now that I look a little closer, it just takes me to the top of the the frame...

niv
August 1st, 2001, 18:52
do you have a link to the page so i can take a look at it?

lucifer
August 2nd, 2001, 04:27
bit of advice

just test things on simple pages then when you get them working add them to your pages. This will save you much time

also it's javascript/HTML so it can't be in PHP unless you echo it :p

Lucky13
August 2nd, 2001, 11:47
oh it's echoed...don't worry =)