0

I wanna know how to delete a part of urls using javascript here's an example :

1.bp.blogspot.com/-gAOB6nWGgT0/Vtmbryn-e-I/AAAAAAAAWG0/jE5iiKmzi0Q/**s72**-c/imga0343.jpg

2.bp.blogspot.com/-zO5IrZEk-ck/VthrVoL0H4I/AAAAAAAARBw/LvQFWENcVB0/**s72**-c/s7e.jpg

3.bp.blogspot.com/-dfwIePlSYWw/Vtl5w0YqmBI/AAAAAAAARC8/BOeebRHZWzA/**s72**-c/facema.jpg

I wanna delete this part of urls :**s72**

1 Answer 1

1

I don't know what you scenario is, but If you just want to delete the s72 from the url and use it elsewhere, it's as easy as

javascript:

var url = window.location.href;
var newUrl = url.replace(/\/s72-/, "/-");
//then if you want to navigate to the new url,
window.location.href = newUrl;
Sign up to request clarification or add additional context in comments.

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.