How to send triimed data using $.get() see code snippet below:
$("#txtSearch").keyup(function() {
$.get("/controller/method/",
{ 'param1': $.trim($("#txtSearch").val()) !== "" ? $.trim($("#txtSearch").val()) : return false; },
function(data) {
$("#div").html(data);
});
});
This results in syntax error whether or not i give semi colon(":") after return false. So i just want to ask should i use var & assign txtBox data to var & then serach if yes then how to use var after giving 1st parameter i.e url path in $.get as i am using it inside of keyup function so i have to trim data inside of $.get.