Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to mimic HTML target command

Status
Not open for further replies.

OmahaVike

Programmer
Joined
Apr 15, 2003
Messages
4
Location
US
Okay, I'm in a pickle.

I've tried my best for what seems like days to get this thing to work, and it appears that only html will handle it. I'm not as familiar with JS as most of you, so I'm hoping this will be a quick fix.

The Problem:
I have an series of iframes within an iframe (i'm doing some windowing stuff, so i need it structured like this). Anyhow, to control src of the iframes within the the iframe from the outter window, it appears that only a straight shot link like "<a href="blahblah" target="insidewindowname">link</a>" will work.

I've tried up and down the river with getElementByID and it just ain't happening. I've even tried document.getElementByID['outerIFrame'].frames['innerIFrame'].src = blah. Its not recognizing the object.

So.... from the outter window, an html link like the one posted above works great. Is there a function I can use in JS to mimic the behavior of the html link?

I have qwerty/asdf/zxcv imprinted on my forehead from so much banging. Very much appreciated for any and all help.
 
window.open('link.html','targetName');

Adam
while(ignorance){perpetuate(violence,fear,hatred);life=life-1};
 
don't want a new window. already have one open that i want to target.
 
By the way, it's document.getElementById("myID")

with a lower-case "d" at the end and parentheses instead of square brackets. The second set of square brackets you use should be correct since you're accessing a collection instead of using a method.

Adam
while(ignorance){perpetuate(violence,fear,hatred);life=life-1};
 
It won't open a new window if the target already exists.

Adam
while(ignorance){perpetuate(violence,fear,hatred);life=life-1};
 
adam,

i apologize. you are correct. worked like a charm. thanks cowboy! i had always interpreted that function as being an "open a new window". again, many many thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top