KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have an IFrame in a page and IFrame has some JavaScript. At run time JavaScript in IFrame gives exception which i want to catch on parent window. How to do that? <html> <head> <script type="text/javascript"> var frm123 = document.getElementById("frm123"); frm123.contentWindow.onerror = function() { alert('error caught'); } function loadData() { var oRTE = document.getElementById("frm123").contentWindow.document; oRTE.open(); oRTE.write(txt123.value); oRTE.close(); } </script> </head> <body> <input type="button" onclick="loadData();" value="load"> <input type="text" id="txt123"> <iframe id = "frm123" > </body> </html>
Tags (comma-separated)
Save Edits
Cancel