开发者

child.onload not getting called in IE8 but works in Firefox and Chrome

开发者 https://www.devze.com 2023-01-30 10:48 出处:网络
WhenI click the hyperlink the child.onload function does not get called in IE8. I don\'t know why but works in other browsers.

When I click the hyperlink the child.onload function does not get called in IE8. I don't know why but works in other browsers. Also ther开发者_JAVA百科e are no syntax errors. This snippet I've pasted from the html file.

Also if I assign the child form fields using setTimeout 5 sec etc then it's working in IE8.

JavaScript:

<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) {
        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>

HTML:

<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>
0

精彩评论

暂无评论...
验证码 换一张
取 消