I would like to encode my URL, but I want to convert spaces to plus symbols.
This is what I attempted to do...
var search = \"Testing this here &
encodeURIComponent(search).replace(/%20/g, "+");
What you're doing wrong here is that first you convert spaces to pluses, but then encodeURIComponent converts pluses to "%2B".
encodeURIComponent
"%2B"