Atthapon Junpun-eak
Atthapon Junpun-eak

Reputation: 540

Jquery with IE7 : Object doesn't support property or method?

I'm using Jquery 1.8.2 with IE7 (my clients need it T_T) I created my own function like this

(function($)
{
    $.fn.suggestionBox = function(options)
    { 
       ............
       ...........
    };
})(jQuery);

And when I call it I get error : Object doesn't support property or method 'suggestionBox'

<script>    
$(document).ready(function() {

        $('input[name="myBox"]').suggestionBox({'ajaxUrl' : 'mySuggestions.do', 'targetInputBoxSelector' : 'input[name="myObjName"]'});


});
</script>

Anyways, it works on Chrome and IE8-9. Any ideas?

Upvotes: 0

Views: 1671

Answers (1)

Atthapon Junpun-eak
Atthapon Junpun-eak

Reputation: 540

I finally found that the issue is from having excessive comma on the last element in array. While modern browsers can ignore it, IE7 doesn't.

{A,B,C,}

Changing it to {A,B,C} fix this problem.

Upvotes: 2

Related Questions