I am wondering if how am i able to change the element data by
I haven't had any experience of handlebars.js but from my point of view, you can just put the code just before the
<script> var node = document.getElementById('pre-region'); node.innerHTML = node.innerHTML.replace(',', '+'); </script>
I'll check out the handlebars js in case it does not work.
As you mentioned in the comment, if you need to use it in the HTTP request/URL, you may handle the string using
decodeURIComponent('1%2B44'); // you get '1+44'
Read more about
decodeURIComponent() method from this. In URL, it should be encoded as
You should encode your string when it's used as a part of parameter of HTTP request. Therefore, it looks good if the URL is:
What you need to do is decode the string on your server side. I assume that you are in control of the server side. If you are using Node.js, you can just use
decodeURIComponent() method to decode the parameter. If you're using Python or PHP as your server language, it should be something like
decodeURIComponent() in that language.