user2699883
user2699883

Reputation: 1

Select2 not working in IE7

I am using select2 3.4.2 in my code on a simple input control.

I am populating the control from a web service which returns me the values in Json.

The control works fine in IE8 and above and also in Chrome and Firefox. Is there any fix to make it work in IE7.

Please find my code below:-

<input type="hidden" class="bigdrop" name="optionvalue" id="selectbox-o" style="width: 350px;" />

$(document).ready(function(){
       $('#selectbox-o').select2({
            placeholder: "Choose a Manager",
            allowClear: true,
            ajax: {
                url: managerServiceURL + '/GetManagerNames',
                type: 'POST',
                params: { 
                    contentType: 'application/json; charset=utf-8' 
                    },
                  dataType: 'json',
                  data: function (term, page) {
                      return JSON.stringify({ q: term}); 
                    },
                  results: function (data, page) {
                    return { results: data.d};
                    }
                },
            });
        });

Upvotes: 0

Views: 2678

Answers (2)

Ricardo Braz&#227;o
Ricardo Braz&#227;o

Reputation: 300

select2 is not supported in IE7. See browser support http://ivaynberg.github.io/select2/

Upvotes: 1

Anton Evangelatov
Anton Evangelatov

Reputation: 1417

I think the reason is that you have a trailing comma after the "ajax" block. This breaks JavaScript on IE7.

http://trailingcomma.com/

Upvotes: 3

Related Questions