homepage Welcome to WebmasterWorld Guest from 54.211.73.232
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Javascript and iFrames
mcanada

5+ Year Member



 
Msg#: 3022 posted 10:17 pm on Jan 12, 2005 (gmt 0)

I'm a JavaScript newbie and need some guidence in regards to iFrames and focus.

I have an html file that creates 2 iframes (frame01 and frame02). They are initially empty. What I would like to do is when a user clicks on a link, I would like to have the contents of that html go into frame01. If they click on another link that contents would go into frame02.

Is it possible thru JavaScript to set the "focus" to the desired iFrame before receiving the html content that will go inside of it?

Thanks

 

MikeFoster

10+ Year Member



 
Msg#: 3022 posted 6:31 pm on Jan 21, 2005 (gmt 0)

Is it possible thru JavaScript to set the "focus" to the desired iFrame before receiving the html content that will go inside of it?

Yes... but why not just use the 'target' attribute of the A element?

btw... Welcome to WebmasterWorld :)

mcanada

5+ Year Member



 
Msg#: 3022 posted 6:50 pm on Jan 21, 2005 (gmt 0)

Thanks Mike!

Yes I am now using target= which has been the easiest for me. However we do have a future requirement that would require us to update content in multiple iframes.

I was looking at it from this viewpoint:

focus to iframe 1
send html from server
focus to iframe 2
send html from server
....

I'm not sure that this kind of thing can be done. Understand that I am not working in a PHP or ASP environment. We have our own environment talking to Apache Server. Our environment can output content to the browser as well as receive.

MikeFoster

10+ Year Member



 
Msg#: 3022 posted 8:17 pm on Jan 21, 2005 (gmt 0)

Some variation of the technique used in this demo [cross-browser.com] might be what you need.

mcanada

5+ Year Member



 
Msg#: 3022 posted 8:51 pm on Jan 21, 2005 (gmt 0)

Thanks Mike for the link. I'll check it out.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved