I have a web application containing a silverlight control. When the specific page is accessed that contains the silverlight control a javascript is executed and if this script is executed too early, the script crashes the javascript engine in IE, not even a try/catch can handle the error.
Simple javascript
silverlightHtmlElement.Content.SilverlightApplication.SilverlightMethod();
If the silverlight control element hasn't been fully loaded the script crashes, and not only the script, no further javascript is executed on the page at all.
A simple "if (silverlightHtmlElement.Content.SilverlightApplication)
" to check if the its accessible is enough for a crash.
The problem is that I can't execute the script later on the page. Anyone else seen this before?