This section describes a jQuery implementation of the previous section's to do list. It is just an example of how to use jQuery with TypeScript, not a jQuery primer. It can be skipped by readers that do not have any knowledge of jQuery and who are not interested in using it. Readers who would like learn or to improve their knowledge of jQuery may find some useful references at the end of the chapter.
Once @types/jquery has been installed, following the instructions in the previous section, using jQuery from TypeScript is straightforward. Let's add a jQueryToDo.ts under the ts folder and modify the scripts section of Views/Home/Index.csHTML to use the JavaScript file from jQueryToDo.ts:
@section Scripts{
<script src="~/js/jQueryToDo.js"></script>
}
Then, enclose all code within a function to avoid the creation of global...