Hi all, I have some code on a page that is used to re-direct to another page and pass some parameters. However in the url there are plus + signs that I would like to remove.
Here is the code:
import wixLocation from ‘wix-location’;
let url = wixLocation.url;
function getParametersAsString(url) {
return url.substring(url.indexOf(“?”), url.length)
}
$w.onReady( function () {
setTimeout(() => {
wixLocation.to(“https://myurl.com/forms/apply_2”+ getParametersAsString(wixLocation.url));
}, 100000);
});
export function button28_click(event) {
wixLocation.to(“https://myurl.com/forms/apply_2” + getParametersAsString(wixLocation.url));
}
export function button28_dblClick(event) {
wixLocation.to(“https://myurl.com/forms/apply_2” + getParametersAsString(wixLocation.url));
The result is a perfect redirect, either by time or button click. Here is the resulting url:-
Can someone kindly assist to modify my code so it removes the plus sign in the Mobile Number field of the url. Thank you in advance.