Internet explorer抛出对象不支持JQuery的属性或方法

Internet explorer throwing Object doesnt support property or method with JQuery

本文关键字:属性 方法 JQuery 不支持 explorer 对象 Internet      更新时间:2023-09-26

我认为这是很明显的,但我不能为自己工作。我使用Facebook javascript API允许用户登录到我制作的页面。下面的javascript抛出错误对象不支持这个属性或方法。IE说第一行抛出错误。有人知道我哪里做错了吗?

document.getElementById('auth-loginlink').addEventListener('click', function () {
            FB.login(function (response) {
            }, {scope: 'email,user_likes,read_stream'});

该页面可访问http://claritytrec.ucd.ie:9000/signup

您的页面以Quirks模式运行。在声明文档类型之前,不能有任何字符或空行。

只有IE>= 9知道addEventListener(),用attachEvent()代替旧的IE。您可以通过MSDN页面的左侧链接找到有关IE遗留事件处理模型的更多信息。