Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

target dynamically made iframe.

0 views
Skip to first unread message

Rik

unread,
Nov 2, 2006, 6:28:01 AM11/2/06
to
Hi guys,

First of all: no, frames are not evil in a backend application that should
not be bookmarked or indexed, and is not reliant on browser history :-)

The question:
I made a tabbed invironment, where I can add tabs + corresponding iframes.
On a button-click in one of the iframes, a new iframe + tab are made, and
the form is posted to that frame by target. This works perfectly in Firefox
& Opera, but MSIE stubbornly opens a new window. The iframes have the right
name & id in FF & Opera, but MSIE doesn't seem the grant the option to set
this name, and thus opens a new window.

To break it down to the bare minimum:
In the page itself:

ifr = document.createElement('iframe');
ifr.name = 'test';
ifr.id = 'test';
ifr.src = './test.html';
document.getElementById('tabs').appendChild(ifr);

And in test.html:
alert(window.name);

FF & Opera alert 'test', alert from MSIE is empty. Suspecting a security
issue I checked online as well, and added that site to the trusted sites,
but still no luck... I really wnat to avoid complicated XMLHTTPRequest's
for this.

Any pointers where to look?
--
Rik Wasmus


Rik

unread,
Nov 2, 2006, 7:04:47 PM11/2/06
to
Well, no answer here, and unfortunately haven't found quite the answer I
was looking for.

I've got a workable solution now, as followed:
- I've chosen for a fixed number of frames (20+ tabs open is offcourse
nonsense)
- Premade all frames (hidden) static in the HTML code.
- A hidden input keeps track of all unused frames.
- When the need for a new frame is there:
- The script checks wether there is a frame available.
- If so, create the 'tab' for that frame.
- Set the frame to unavailable for further scripts.
- Set the form target to that frame
- Let it submit.
- Set the form target back to default.
- On closing a tab, hide the frame, and set it available again.

Maybe this saves someone hours and hours of cursing MSIE :-).
--
Rik Wasmus


0 new messages