If you wish to keep the symbols in the URI, but encode them:
encodedURI = encodeURIComponent(crappyURI);
If you wish to build ‘friendly’ URIs such as those on blogs:
niceURI = crappyURI.replace(/[^a-zA-Z0-9-_]/g, '');
If you wish to keep the symbols in the URI, but encode them:
encodedURI = encodeURIComponent(crappyURI);
If you wish to build ‘friendly’ URIs such as those on blogs:
niceURI = crappyURI.replace(/[^a-zA-Z0-9-_]/g, '');