I am new to JQuery and doesn\'t know how to handle errors like uncaught TypeError: undefined is not a function
. I don\'t know how to put the jQuery code below in or
You have one obvious issue that may cause problems. Your HTML has a div with class="results"
, but your selector says #results
(i.e. find an element with id="results"
)
You could change the selector to .results
(as @VeldMuijz suggested in comment), but you also have an Ajax ActionLink
which requires an id as it specifies UpdateTargetId="results"
Instead add the id to your results div.
e.g. change this:
to this:
I also recommend with MVC projects that you put your JS code in separate JS files. Visual Studio can't debug both Razor and Javascript in the same view, but it can if the script is in its own file.