JQUERY AJAX, Issues with spaces being sent to the server, y?
Posted
by nobosh
on Stack Overflow
See other posts from Stack Overflow
or by nobosh
Published on 2010-03-14T18:20:59Z
Indexed on
2010/03/14
18:25 UTC
Read the original article
Hit count: 238
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?
© Stack Overflow or respective owner