Closed Thread Icon

Topic awaiting preservation: Make a link open pages in two different frames Pages that link to <a href="https://ozoneasylum.com/backlink?for=8880" title="Pages that link to Topic awaiting preservation: Make a link open pages in two different frames" rel="nofollow" >Topic awaiting preservation: Make a link open pages in two different frames\

 
Author Thread
krets
Paranoid (IV) Mad Scientist

From: KC, KS
Insane since: Nov 2002

posted posted 10-01-2003 17:44

I'm having no luck finding any information on how to do this:

I have a page with two frames, a menu frame at the top and a main frame below it. I want a link to open a page in the main frame and a page in the menu frame. I know it's doable but how?

:::11oh1:::

Veneficuz
Paranoid (IV) Inmate

From: A graveyard of dreams
Insane since: Mar 2001

posted posted 10-01-2003 18:18

The only way I can think of doing that is using javascript, which is probably the solution you're looking for since you posted it here...

code:
function doLink(var lnk) {
window.parent.<nameOfFrame1ToChange>.location.href = lnk;
window.parent.<nameOfFrame2ToChange>.location.href = lnk;
}

....
<a href="#" onClick="doLink('http://www.com'); return 0">link here</a>



Not sure if that code works, but it should as far as I know. If it doesn't you'll at least get the idea of how it could be done.

But the best solution would be to drop the frames all together

_________________________
"There are 10 kinds of people; those who know binary, those who don't and those who start counting at zero"
- the Golden Ratio -

[This message has been edited by Veneficuz (edited 10-01-2003).]

krets
Paranoid (IV) Mad Scientist

From: KC, KS
Insane since: Nov 2002

posted posted 10-01-2003 18:48

Believe me, I lobbied for dropping the frames altogether until I was blue in the face. Unfortunately, that's how the boss wants it so that's how it stays.

I ended up using something similar to what you said like this:

onClick='parent.main.location.href="whatever.html"'

It works great in IE and that's all we care about because these pages are going onto a CD for use in our systems and they only have IE installed. Captive audiences... gotta love 'em.

Thanks.

:::11oh1:::

[This message has been edited by krets (edited 10-01-2003).]

Nevel
Bipolar (III) Inmate

From: Amsterdam
Insane since: Jun 2002

posted posted 10-01-2003 19:46

Can I advise you on a birthday gift for your boss?
Well, I'll do it anyway :
http://www.zeldman.com/dwws

Scott
Bipolar (III) Inmate

From: schillmania.com
Insane since: Jul 2002

posted posted 10-21-2003 22:28

I know this is really nitpicky, but just in case the browser doesn't support JS (and so search engines etc. can see it better) - take advantage of the HREF property.

Instead of
<a href="#" onClick="doLink('http://www.com'); return 0">link here</a>

I'd use:
<a href="http://www.com" onClick="doLink(this.href); return 0">link here</a>


[This message has been edited by Scott (edited 10-21-2003).]

« BackwardsOnwards »

Show Forum Drop Down Menu