With this in the <head> section of an HTML document:
<style type="text/css">
.scBuffH {position:absolute;visibility:hidden;}
</style>
<ilayer id="scServerBuffer" name="scServerBuffer" class="scBuffH">
<iframe id="scServerBuffer" name="scServerBuffer" class="scBuffH">
</iframe>
</ilayer>
and this external script to access it:
var NN4=(document.layers) ? true : false; // Netscape 4.x only
var IE4=(document.all && !document.getElementById) ? true : false;
var IE6NN7=(document.getElementById) ? true : false;
function CitServerComm() {
CIT_SERVER_COMM=this;
this.buffer='scServerBuffer';
this.errorMsg='';
this.callbackObject=null;
};
CitServerComm.prototype.getBuffer=function() {
if (IE6NN7) {
// this generates an error in NN7 only
//return document.frames[this.buffer];
// this won't work in IE or NN7
return document.getElementById(this.buffer);
} else if (NN4) {
return document.layers[this.buffer];
}
};
CitServerComm.prototype.changeBuffer=function(url) {
var buf = this.getBuffer();
if (IE6NN7) {
// when getBuffer() returns document.frames[this.buffer],
// this works for IE6 but not NN7
//buf.location.href=url;
// when getBuffer() returns document.getElementById(this.buffer),
// this works for IE6 but not NN7
//this.getBuffer().src=url;
buf.setAttribute("src", url);
} else if (NN4) {
buf.load(url,400);
}
};
... then I can't set the url of the iframe. It either just does nothing or says document.farmes has no elements. What am I doing wrong?
Thanks!
<style type="text/css">
.scBuffH {position:absolute;visibility:hidden;}
</style>
<ilayer id="scServerBuffer" name="scServerBuffer" class="scBuffH">
<iframe id="scServerBuffer" name="scServerBuffer" class="scBuffH">
</iframe>
</ilayer>
and this external script to access it:
var NN4=(document.layers) ? true : false; // Netscape 4.x only
var IE4=(document.all && !document.getElementById) ? true : false;
var IE6NN7=(document.getElementById) ? true : false;
function CitServerComm() {
CIT_SERVER_COMM=this;
this.buffer='scServerBuffer';
this.errorMsg='';
this.callbackObject=null;
};
CitServerComm.prototype.getBuffer=function() {
if (IE6NN7) {
// this generates an error in NN7 only
//return document.frames[this.buffer];
// this won't work in IE or NN7
return document.getElementById(this.buffer);
} else if (NN4) {
return document.layers[this.buffer];
}
};
CitServerComm.prototype.changeBuffer=function(url) {
var buf = this.getBuffer();
if (IE6NN7) {
// when getBuffer() returns document.frames[this.buffer],
// this works for IE6 but not NN7
//buf.location.href=url;
// when getBuffer() returns document.getElementById(this.buffer),
// this works for IE6 but not NN7
//this.getBuffer().src=url;
buf.setAttribute("src", url);
} else if (NN4) {
buf.load(url,400);
}
};
... then I can't set the url of the iframe. It either just does nothing or says document.farmes has no elements. What am I doing wrong?
Thanks!