0

I'm making an ebay template for myself, and I want to use a name anchor to jump to different section on the page template. But Ebay adds something to the URL therefore breaking the name anchor.
Since this seems to be Firefox related only, someone suggested that I need to strip "&bv=mozilla" from the URL then it would work. If there are any javascript experts out here that can help me out, I would highly appreciate it.

2 Answers 2

1
var documentUrl = location.href;
var newUrl = documentUrl.replace("&bv=mozilla","");
Sign up to request clarification or add additional context in comments.

Comments

0

Try this:

var url = location.protocol + '//' + location.host + location.pathname;

or this:

var url = location.protocol + '//' + location.host + ':' + location.port + location.pathname;

if it is on the same page.

Otherwise, you could try this:

var url = 'insert URL here';
var new_url = url.substring(0, url.indexOf('?'));

See substring, indexOf and window.location.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.