Internet explorer says Object doesn't support this property or method

后端 未结 8 903
遥遥无期
遥遥无期 2021-01-07 03:14

This line is 79:

window.addEvent(\'domready\', function(){     
    mySlide = new Fx.Slide(\'advert\');
    mySlide.hide();
});

It also doe

相关标签:
8条回答
  • 2021-01-07 03:24

    Just a quick addition to the conversation.

    In some cases (video.js / bigvideo.js come to mind) you need to run modernizr.js as your first script before jQuery or jQuery UI. Clears things right up.

    0 讨论(0)
  • 2021-01-07 03:27

    (MooTools)

    My code was something like this:

    var cancel; 
    //... bla bla
    cancel = form.elements[i]; //cancel is now a <button>; no Id, unique on the page
    cancel.addEvent('click', function(e) {...});
    

    And I was getting the OP's exception on cancel.AddEvent(). What fixed it for me was rewriting that as $(cancel).addEvent().

    What a horrible browser.

    0 讨论(0)
  • 2021-01-07 03:29

    This can also happen if you don't have a comma in a list of variables, like the 'f' variable below :

    var a = 'aaaa',
        f = 'ffff'
        b = someObject.attribute;
    
    0 讨论(0)
  • 2021-01-07 03:30

    This error normally comes with IE if you try to assign a invalid value for a style property. If you are using IE8 and you have enabled enable javascript debugging under tools->options->advanced, then you can try to debug it and see which property assignment is throwing this error and then try to rectify this.

    0 讨论(0)
  • 2021-01-07 03:31

    Do you have jQuery/mooTools included before this particular line in the file? It looks to me like you've included a plugin or other javascript before including the framework that it relies on. I assume you're also using jQuery in noConflict() mode since you're using both jQuery and mooTools.

    0 讨论(0)
  • 2021-01-07 03:31

    +1 for the earlier answer about variable names. This in IE8:

    title = button.attr('title'); <-- Object doesnt support this method
    
    $title = button.attr('title'); <-- OK!
    
    0 讨论(0)
提交回复
热议问题