//this is the script that will send call the php file var IFrameObj; // our IFrame object var elementID; // element ID of div where you want to display the content function callToServer(goToURL, getId) { if (!document.createElement) {return true}; var IFrameDoc; var URL = goToURL; elementID = getId; if (!IFrameObj && document.createElement) { // create the IFrame and assign a reference to the // object to our global variable IFrameObj. // this will only happen the first time // callToServer() is called var tempIFrame=document.createElement('iframe'); tempIFrame.setAttribute('id','RSIFrame'); tempIFrame.style.border='0px'; tempIFrame.style.width='0px'; tempIFrame.style.height='0px'; IFrameObj = document.body.appendChild(tempIFrame); if (document.frames) { // this is for IE5 Mac, because it will only // allow access to the document object // of the IFrame if we access it through // the document.frames array IFrameObj = document.frames['RSIFrame']; } } if (navigator.userAgent.indexOf('Gecko') !=-1 && !IFrameObj.contentDocument) { // we have to give NS6 a fraction of a second // to recognize the new IFrame setTimeout('callToServer()',10); return false; } if (IFrameObj.contentDocument) { // For NS6 IFrameDoc = IFrameObj.contentDocument; } else if (IFrameObj.contentWindow) { // For IE5.5 and IE6 IFrameDoc = IFrameObj.contentWindow.document; } else if (IFrameObj.document) { // For IE5 IFrameDoc = IFrameObj.document; } else { return true; } IFrameDoc.location.replace(URL); return false; } //this is the script that will grab the data from the php file function handleResponse(msg) { document.getElementById(elementID).innerHTML = msg; document.getElementById(elementID).style.display = 'block'; } function handleResponseHide() { document.getElementById(elementID).style.display = 'none'; }