My original code:
self.init = function() {
$('.search-btn').on('click', function() {
var searchTerm = $('#searchTerm').val();
self.doSearch(searchTerm);
});
};
It turns out it was a mistake I made by not returning a value from the annoymous function, so it would stop flow of execution.
self.init = function() {
$('.search-btn').on('click', function() {
var searchTerm = $('#searchTerm').val();
self.doSearch(searchTerm);
return false;
});
};
No comments:
Post a Comment