PDA

View Full Version : Changing iFrame src Attribute in IE6


brett.goodwin
06-12-2007, 04:16 PM
Hi Everyone,
I'm developing an application that acts as kind of a "browser within a browser" to allow my support department to perform QA on sites that we develop. I've got it running exactly how I want it!... but only in Firefox and Safari. For some reason it doesn't work AT ALL in IE6, and it's important that we are able to use this to QA all types of browsers.

So far, the best I can figure is that IE isn't properly handling the request to change the src attribute of the iFrame. Currently it reads:

document.getElementById('qaframe').src = ajaxRequest.responseText;

I have also tried

document.getElementById('qaframe').location = ajaxRequest.responseText;

and

window.frames['qaframe'].location = ajaxRequest.responseText;

I have attached copies of the source of the index page and its associated javascript functions. Any help or advice is appreciated!

brett.goodwin
06-12-2007, 04:35 PM
Okay, I think my previous diagnosis was incorrect. After adding in a bunch of variable-alerts, it seems like the script is actually failing to correctly retrieve the value of a dropdown list on the page. Here is the code I am using:
var siteList = document.getElementById('current_site');
var newSite = siteList.options[siteList.selectedIndex].value;
The variable newSite ends up as an empty string in IE6.

brett.goodwin
06-12-2007, 05:21 PM
Okay, so I needed to be using .text instead of .value when selecting the content of the list. This thread is now obsolete, and I seem to have fixed my own problem. Maybe a mod can close it? Thanks.