Note that there are some explanatory texts on larger screens.

plurals
  1. POPage throws JavaScript runtime error: 'Function name' is undefined. IE10 only
    primarykey
    data
    text
    <p>While working on IE10, I have found that the JavaScript functions which are registered or called from the code behind are throwing exception:</p> <blockquote> <p>"JavaScript runtime error: 'function name' is undefined".</p> </blockquote> <p>For ex: Code behind in the (!IsPostBack) block:</p> <pre><code>Page.RegisterStartupScript("showGCAlert", "&lt;script language=\"javascript\"&gt;ShowGCAlert();&lt;/script&gt;"); </code></pre> <p>PageView:</p> <pre><code>function ShowGCAlert() { alert('GCAlert'); if(document.getElementById('hdnGCAlert').value != "1") { document.getElementById('divGCAlert').style.display = "Block"; document.getElementById('chkReminder').focus(); document.getElementById('btnLogin').disabled = true; document.getElementById('Button2').disabled = true; } else { document.getElementById('divGCAlert').style.display = "none"; document.getElementById('btnLogin').disabled = false; document.getElementById('Button2').disabled = false; if (document.getElementById("txtUsername").value != "") document.getElementById("txtPassword").focus(); else document.getElementById("txtUsername").focus(); } } </code></pre> <p>When the page loads its throws the exception even though the <code>ShowGCAlert()</code> exists on the dynamic page.</p> <p>After continuing the exception design page shows:</p> <pre><code>&lt;script language="javascript" src="/ABC/DEF/Scripts/Common.js"&gt;&lt;/script&gt; &lt;script language="javascript"&gt; document.body.style.overflowY="hidden"; document.body.style.overflowX="hidden"; var jsAppName ='ABC'; &lt;/script&gt; &lt;script language="javascript"&gt; function window.onresize() { document.cookie = "resX=" + document.body.clientWidth + ";resY=" + document.body.clientHeight + ";path=/"; } window.onresize(); &lt;/script&gt; &lt;script type="javascript"&gt; ShowGCAlert(); &lt;/script&gt; &lt;script language="javascript"&gt; document.getElementById('txtPassword').focus(); &lt;/script&gt; </code></pre> <p>In ie9 or IE10 compatibility view its working fine. Please show me where i am doing wrong.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload