I have adapted some code to populate drop-down selection boxes via MySQL queries, and my final ‘result’ needs to be appended to a new “search” URL.
var result = $("select#model option:selected").html();
$.post (location.href="advanced_search.php?" + "keywords=" + result, function(data){;
My problem is result includes spaces that I need to convert to +, so:
/advanced_search.php?keywords=2001-2004 Honda Civic TypeR
needs to read:
/advanced_search.php?keywords=2001-2004+Honda+Civic+TypeR
I’ve spent all evening looking for a solution, but I am having a very hard time finding something I can implement with my limited skills!
Just
.replace(/ /g,'+')it, although I must admit I’m confused as to what your code is doing exactly.