SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
-
Mar 5, 2002, 12:35 #1
- Join Date
- Feb 2002
- Location
- Birmingham UK
- Posts
- 42
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
forcing links to _top with javascript
My page has got two frames, one at the top for a menu and one for content. I want some links in the topframe to be targetted to the "_top" of the browser window with Javascript.
What is the syntax for this?
Thanks,
-
Mar 5, 2002, 12:46 #2
- Join Date
- Dec 2001
- Location
- Montréal
- Posts
- 729
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
When you say targetteed to the _top, do you actually mean another new browser window or the top frame of your frameset?
If you mean overwriting the window (replacing what's inside it), then it's simply target="_top" and if you mean the top frame of your frameset, then its target="nameofthetopframe".
Somehow, I feel this is not what you mean though. This has nothing to do with javascript, it's purely html.
If I'm offtrack, please be more specific.Last edited by cybercodeur; Mar 5, 2002 at 12:50.
Denis Boudreau <C²/> - Web Standards & Accessibility
[+] ICQ number: 115649885 || Email: denis@cybercodeur.net
[+] Daily Weblog on Web standards and accessibility : CYBERcodeur.net
-
Mar 5, 2002, 12:48 #3
- Join Date
- Mar 2001
- Location
- the windy city
- Posts
- 281
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Code:<a href="file.htm" target="_top">target "_top"</a>
Goals are dreams with deadlines
-------------------------------------
Nimlok Trade Show Displays Booths and Exhibits
-
Mar 5, 2002, 12:53 #4
- Join Date
- Feb 2002
- Location
- Birmingham UK
- Posts
- 42
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
top of the browser window
I want the links to load pages over all of the current frames (as HTML 'TARGET="_TOP"' does it).
But I can't use HTML as I am using an ASP component that creates menu's and the only way it links through is with Javascript location.href.
Thats why I'm restricted to Javascript.
Just to be more detailed, I have a menu in the top frame. Content in the bottom frame. Some of the links need to jump out of the frameset and take over the whole browser window and these need to be done with Javascript links.
Hope this is easier to understand now...
-
Mar 5, 2002, 13:08 #5
- Join Date
- Dec 2001
- Location
- Montréal
- Posts
- 729
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I believe it would simply be parent.window.top or window.top but I wouldn't bet too much on it...
Denis Boudreau <C²/> - Web Standards & Accessibility
[+] ICQ number: 115649885 || Email: denis@cybercodeur.net
[+] Daily Weblog on Web standards and accessibility : CYBERcodeur.net
-
Mar 5, 2002, 14:16 #6
- Join Date
- Dec 2001
- Location
- Montréal
- Posts
- 729
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
okay I tested this and it works. Forget what I told you earlier, this is it.
onclick="top.location.href='yourpage.asp';"
That's it!Denis Boudreau <C²/> - Web Standards & Accessibility
[+] ICQ number: 115649885 || Email: denis@cybercodeur.net
[+] Daily Weblog on Web standards and accessibility : CYBERcodeur.net
Bookmarks