eddjc
05-27-2009, 09:32 AM
Hi there,
I've been using a hidden iframe for remote server scripting - how i've been doing it is that a load(); function changes the src component of the iframe with $_GET variables to pass to PHP:
this.load = function () {
this.iframe.src = this.file + "?action=load&gid=" + this.gid + "&last_modified=" + this.last_modified;
}
The frame itself then has an "onload" function that calls a doLoad(); function that handles receipt of any information back from the server. declared this way:
<iframe id="loader" onload="loader.doLoad();" style="width:0px;height:0px;border:none;"></iframe>
The trouble with this as you may guess is that the page was reloading every time src was changed and the history list of the browser was messed up. So I did some research and came up with this method that solves that problem:
this.load = function () {
//this.iframe.src = '';
this.iframe.contentWindow.document.location.replace(this.file + "?action=load&gid=" + this.gid + "&last_modified=" + this.last_modified);
}
Which is great, but now onload doesn't call! Any ideas for a replacement?
Thanks
Edd
I've been using a hidden iframe for remote server scripting - how i've been doing it is that a load(); function changes the src component of the iframe with $_GET variables to pass to PHP:
this.load = function () {
this.iframe.src = this.file + "?action=load&gid=" + this.gid + "&last_modified=" + this.last_modified;
}
The frame itself then has an "onload" function that calls a doLoad(); function that handles receipt of any information back from the server. declared this way:
<iframe id="loader" onload="loader.doLoad();" style="width:0px;height:0px;border:none;"></iframe>
The trouble with this as you may guess is that the page was reloading every time src was changed and the history list of the browser was messed up. So I did some research and came up with this method that solves that problem:
this.load = function () {
//this.iframe.src = '';
this.iframe.contentWindow.document.location.replace(this.file + "?action=load&gid=" + this.gid + "&last_modified=" + this.last_modified);
}
Which is great, but now onload doesn't call! Any ideas for a replacement?
Thanks
Edd