I am making a call via jquery to load a piece of HTML from the Django server.
$('#search_result').load(url, function(){
...
});
The url is created like this:
url = url + '&' + keyword + '=' + value;
As long as the keywords have no space, its working fine, but something like “Fixed Bid” gets cut off to simply “Fixed”, which is a problem.
/deals/?ajax&sales_term=Fixed
Should I replace the space by something else? It would be great if I could replace it with a character that Django recognizes as space and converts it back upon retrieval. That would be really efficient.
You have to encode your URL. Try this: encodeURIComponent. The issue is, you need to represent the space with %20, which encodeURIComponent would take care of.