by Andreas

Microsoft JScript error: jQuery.tmpl is too old

If you ever encounter the following error message when using string-based templates (or a component that uses it, like simpleGrid) for KnockoutJS:

Microsoft JScript runtime error: Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.

you’d expect to just download the latest jQuery.tmpl plugin and get on with your life. This is not the case however, because from KnockoutJS version 2.0.0 jquery.templ are no longer supported. You’ve got two options:

1. Avoid using string-based templates (use native control flow bindings instead)

2. Download this version of jquery.tmpl: jquery-tmpl 1.0.0pre from github. And make sure you add the script reference before the knockout library:

<script src="../Scripts/jquery-ui-1.8.23.js"></script>
<script src="../Scripts/jquery.tmpl.js"></script>
<script src="../Scripts/knockout-2.1.0.js"></script>
<script src="../Scripts/knockout.simpleGrid.js"></script>