I'm doing a function in Jquery
and Javascript
in which I have to pass a parameter through the url.
This parameter contains the characters /
and +
, so I have to replace them so that there are no problems in the url.
When using the code:
var selectId = $("#parametroSel").val().replace(/\//g, ":::").replace(/+/g, "::::");
In the javascript console, this error is logged:
SyntaxError: nothing to repeat
What could be the problem?