Hi dudes. I’m trying to write an Ajax call using an iframe. (on purpose). However I seem to have quite the dificulty appending the iframe to the body element. Here is my script:
[CODE]function createFrame() {
var bodyElement = document.getElementsByTagName(“body”);
alert(bodyElement);
try {
var frameElement = document.createElement(“<iframe id=’xClBrCommFrame’ style=’display: none;’></iframe>”);
} catch(e) {
var frameElement = document.createElement(“iframe”);
frameElement.setAttribute(“id”, “xClBrCommFrame”);
frameElement.setAttribute(“style”, “display: none;”);
}
alert(bodyElement);
bodyElement.appendChild(frameElement);
}
It’s been driving me insane for two days now and I can’t figure it out even though I have used the same method, even code, before. Go figure…
Anyway, I keep getting a JS error from FF saying: “bodyElement.appendChild is not a function”
Please HALP!!!