JQUERY AJAX, Issues with spaces being sent to the server, y?
- by nobosh
I'm using the following code to post to the server which is then sent to a MYSQL query to find matches via search.
$.ajax({
url: '/search/spotlight/',
data: "q=" + $(this).val(),
success: function(data) {
}
});
When Q's val has spaces in it, it's creating problems. I'm wondering if I'm handling this correctly? Do I need to encode the value in the AJAX call? Or is this a problem on my backend, which is ColdFusion
Right now JQUERY is posting the following to the server:
/search/spotlight/?q=FirstName%20LastName
is this right?