1

I have a problem with using jquery with knockout in ie8. Looks like binding using jquery to various events like: click, focus, so on is not working properly. Let's see some code, example from jqueryui

<!--ko with: someModel -->

<input id="tags" />

<--/ko-->

<script>
$(function() {
  var availableTags = [
  "Java",
  "JavaScript"
];
$( "#tags" ).autocomplete({
            source: function (request, response) {

                    response($.map(data, function (item) {
                        return {
                            label: item,
                            value: item
                        }
                    }))
            }
        });
 });
</script>

There is no error, nothing. Just source callback is never called. If I put input element outside any knockout context everything is fine. Similar problem is with other actions, like jquery placeholder plugin and knockout.

Both jquery and knockout claims to work with ie8, what is causing the problem. How can I solve it?

Mat38
  • 97
  • 1
  • 12
  • 1
    Since knockout runs on top of jQuery, it's not usually a good idea to use pure jQuery bindings within a knockout application. You should consider building a custom _knockout binding handler_ to handle the autocomplete widget. You may want to check out [this answer](http://stackoverflow.com/questions/15694425/connect-knockout-and-jqueryui-autocomplete#answer-15713822) for an idea on how to do that... – War10ck Aug 01 '13 at 12:54
  • Thanks, I will look into this. I just found out that I can also use jquery after I bind knockout models. According to [this](http://stackoverflow.com/questions/17408616/knockout-nested-bindings-interfere-with-jquery-click-in-ie7-ie8?rq=1) – Mat38 Aug 01 '13 at 13:16

0 Answers0