pstein Posted August 13 Posted August 13 Occasionally webpages show an URL with an appended "?" and a tracking code like http://www.foobar.com/some/path/before.html?after-is-tracking=12345 Assume I assign this URL to a variable: How can I remove (with Javascript or even better with jQuery) everything after "?" including the "?" itself?
dsonesuk Posted August 13 Posted August 13 var url = "http://www.foobar.com/some/path/before.html?after-is-tracking=12345"; var cleanurl=""; cleanurl=url.split("?")[0];
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now