Internet Explorer javascript error points to HTML
I have an error on my site triggered by Internet Explorer开发者_Go百科 8 when I first enter the page. The debugger says:
Object doesn't support this property or method
widget, line 48 character 3
I click on the error to take me to the line. It leads me to HTML. How is it possible that HTML triggered a JS error?
I have not clicked this anchor. The error appeared upon page load. Can someone give me leads on where I should be looking to find the real problem?
Live site: http://veetle.com/index.php/widget#3D598BC5A2144C53D2797CF7EDEF083A/true/default
This is probably the source of the issue:
onclick="VEETLE.Players.instance().getPlayer().togglePlayer(); return false"
The reason for the error is probably the VEETLE
object not being defined yet.
Try placing the SCRIPT that defines that object into the HEAD of the page.
Consider this:
var po = document.getElementById('playOverlay');
po.onclick = function() {
VEETLE.Players.instance().getPlayer().togglePlayer();
return false;
}
... instead of the onclick attribute.
精彩评论