I know similar questions have been asked, but I couldn't find any answer. There is a JavaScript function:
function init(url) {
$('#id_search').keyup(function() {
performsearch(url, e);
});
}
I am trying to pass event object and the url parameter to the performsearch function:
function performsearch(url, e){
e.preventDefault();
console.log('perf->' + url);
}
But e.preventDefault() gives an error:
e is not defined
What is wrong in this function call?
.keyup(function(e){rather.on("input", function(e){?! Theoninputevent will trigger also on copy paste etc events...