| View previous topic :: View next topic |
| Author |
Message |
IonDune
Joined: 22 May 2005 Posts: 12
|
Posted: Sun May 22, 2005 1:35 pm Help Please!!! |
|
|
|
I am making my site using frames. I have a titlebar frame at the top, a frame at the side with links for other parts of my site, and a larger frame in the center that holds the info the page is holding.
my problem is that when i click a link from the frame on the side it opens the link inside that frame. I need a way for a link to not open a link in the frame, but to open a whole new page. Can i do this? |
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8205 Location: Castle Rock CO USA
|
Posted: Sun May 22, 2005 2:15 pm |
|
|
|
Try adding
to the a href tag
If you are working in XHTML strict, create a js file:
| Code: |
function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute("href") &&
anchor.getAttribute("rel") == "external")
anchor.target = "_blank";
}
}
window.onload = externalLinks; |
and name it external.js
Now add this to your webpage
| Code: |
<script type="text/javascript" src="/external.js">
</script> |
And then to apply it:
| Code: |
| <a href="http://www.loud800.com" rel="external"> |
|
|
IonDune
Joined: 22 May 2005 Posts: 12
|
Posted: Sun May 22, 2005 2:18 pm |
|
|
|
umm sorry i'm kind of new to this...
i am using geocities and this is what the code is on my page:
<HTML>
<HEAD>
<TITLE>IonDuneCentral</TITLE>
</HEAD>
<FRAMESET ROWS="15%,*">
<FRAME SRC="titlebar.html" NAME=TITLE SCROLLING=NO>
<FRAMESET COLS="20%,*">
<FRAME SRC="sidebar.html" NAME=SIDEBAR>
<FRAME SRC="mainpage.html" NAME=RECIPES>
</FRAMESET>
</FRAMESET>
</HTML>
what should i add so that the links in the "sidebar.html" change whats in the area"mainpage"? |
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8205 Location: Castle Rock CO USA
|
Posted: Sun May 22, 2005 2:26 pm |
|
|
|
You should add
to the hyperlink you want to open in the new window.
For example, if you have
| Code: |
| <a href="http://www.cnn.com">CNN</a> |
you would add:
| Code: |
| <a target="_blank" href="http://www.cnn.com">CNN</a> |
|
|
IonDune
Joined: 22 May 2005 Posts: 12
|
Posted: Sun May 22, 2005 2:34 pm |
|
|
|
thankyou, that solved my first problem, but i wanted it to open in the same window, just not in the individual frame. how could i do that?
EDIT: Wait i figured it out. mayeb i should have payed more attention to what u said the first time... lol ty
Last edited by IonDune on Sun May 22, 2005 2:39 pm; edited 1 time in total |
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8205 Location: Castle Rock CO USA
|
Posted: Sun May 22, 2005 2:37 pm |
|
|
|
| Change the target to the name of the frame you want it to open in |
|
IonDune
Joined: 22 May 2005 Posts: 12
|
Posted: Sun May 22, 2005 2:39 pm |
|
|
|
| thank you i got it working. |
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8205 Location: Castle Rock CO USA
|
Posted: Sun May 22, 2005 2:41 pm |
|
|
|
| Anytime - good luck with the site! |
|
|