code
I am trying to find out what parent="top" does. Any one of you whizes outthere know? someone told me thet it was bad code someone else told me it does something but they did't know what. So I am just looking for the CORRECT answer. Thanks for any help
doublehelix posted this at 20:49 — 14th March 2002.
They have: 117 posts
Joined: Feb 2002
It is javascript that is used to break out of frames. The full code, placed at the start of your body, would look like this:
<script language="JavaScript">
if (window != top) {top.location.href = location.href;}
</script>
Errr... BTW, don't leave the fact that there is no parent=top in my code snippet bother you -- does the same thing.
pa2000 posted this at 21:24 — 14th March 2002.
They have: 2 posts
Joined: Mar 2002
doublehelix;
If the code,parent="top" is not in a java tag will it still work? This is how I found it:
Busy posted this at 21:33 — 14th March 2002.
He has: 6,151 posts
Joined: May 2001
parent="top" is really a frame tag, its a target tag which is used in links to open target frames.
other targets are parent, new, blank and self
Suzanne posted this at 21:33 — 14th March 2002.
She has: 5,507 posts
Joined: Feb 2000
That should be target="_top" and only used in frames to pop the link out of frames but keep it in the same browser window. Someone was confused. There is no valid attribute for the anchor tag named "parent".
Busy posted this at 21:55 — 14th March 2002.
He has: 6,151 posts
Joined: May 2001
doh, I didnt even notice the parent vs target bit
*still on my first coffee*
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.