Use the JavaScript built-in function "escape()" or "encodeURIComponent()" to urlencode your data.