How to Encode a URL in JavaScript for Query Strings | CodeTrail