IE & DOM - clanked

C

chimpoid

Hi there,


I have a minor problem with IE updating an i-frame withing a page.
It's straightforward enough. A hidden i-frame reloads and runs a php
script which downloads a listing from a MySQL databse and then cals a
javascript to transfer the content to another visible i-frame thus
preventing any reload flicker.


The code is as follows:

// Code
function insertusers(usersinput){
if(window.frames && window.frames["usersin"]) //IE 5 (Win/Mac),
Konqueror, Safari
aWindow = window.frames["usersin"];
else if(document.getElementById("us­ersin").contentWindow)
//IE
5.5+, Mozilla 0.9+, Opera
aWindow =
document.getElementById("users­in").contentWindow;
else //Moz < 0.9 (Netscape 6.0)
aWindow = document.getElementById("users­in");


if(aWindow.document) //Moz 0.9+, Konq, Safari, IE, Opera
aDocument = aWindow.document;
else //Moz < 0.9 (Netscape 6.0)
aDocument = aWindow.contentDocument;


var neweDiv = aDocument.createElement("DIV")­;
neweDiv.innerHTML = usersinput;
a = aDocument.getElementById("user­things")
b = aDocument.getElementById("newe­Div")
go = a.removeChild(b);

aDocument.getElementById("user­things").appendChild(neweDiv);


}
// End Code

The content works fine in mozilla and runs as expected dropping the
contents of usersinput (in the head of the function) as a child of the
div in 'a'.
In IE the error returned is: 'a' null or not an object
I have used alert to check that it is readin everything correctly as
far down as aDocument. I have also checked and the div userthings
exists and should be reading correctly but IE seems to balk at this and
kill the script.

Any thoughts would be most appreciated

Chimp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,002
Messages
2,570,261
Members
46,859
Latest member
VallieMcKe

Latest Threads

Top