I want set a field of child window. But since the function attached to child.onload does not get called in IE8 how to set the child window form field for IE8 then? Currently I'm using a crude way of setInterval 5 seconds so that that field will be set non-stop every 5 seconds since I don't know without onload when the child window has finished loading. Here alert("In onload"); will not be called in IE8 but gets called in other browsers. Here is the snippet from the html file: <script type="text/javascript"> function openWindow(){ var child=window.open("index.php?option=com_aicontactsafe&pf=4&tmpl=component",'win2','width=400,height=350,menubar=yes,resizable=yes'); if(child!==null) { setInterval(function() { child.document.getElementById("aics_ForDocument_Title").value=window.document.getElementById("documentname").innerHTML; child.document.getElementById("aics_FormURL").value="$referer"; child.document.getElementById("aics_FormURL").readOnly=true; child.document.getElementById("aics_FormURL").disabled=true; }, 5000); child.onload=function() { alert("In onload"); child.document.getElementById("aics_ForDocument_Title").value=window.document.getElementById("documentname").innerHTML; child.document.getElementById("aics_FormURL").value="$referer"; child.document.getElementById("aics_FormURL").readOnly=true; }; } return false; } </script> <div id="reportthis"><a href="#" onclick=" openWindow();"><img src="images/instruments/reportthis.jpg" width="110" height="31" alt="Report This" title="Report this document for any issues" /></a></div> Code (markup):
Hi rag_gupta, I haven't look at your actual needs yet, but a glimpse at your code prompt me to declare the child var global, i.e. ...<script type="text/javascript"> [COLOR="seagreen"]var child=null;[/COLOR] function openWindow(){ [COLOR=red]/*var*/[/COLOR] child=window.open("index.php?option=com_aicontactsafe&pf=4&tmpl=component",'win2','width=400,height=350,menubar=yes,resizable=yes'); if(child!==null){... Code (markup): This is because you are using 2 (what do we call these, unnamed?) functions. Hendra