-2

with the same principle than this script, how could i change a url

from

http://abc.com/radiofr/my/Person.aspx?accountname=radiofr\Administrateur

to

http://abc.com/radiofr/intranet/_layouts/rf.portal.web/person.aspx?accountname=radiofr\Administrateur

0

2 Answers 2

0

why not just replace the /my/

var s='http://abc.com/radiofr/my/Person.aspx?accountname=radiofr\Administrateur';

alert(s.replace(/\/my\//,'intranet/_layouts/rf.portal.web/'));
Sign up to request clarification or add additional context in comments.

Comments

0

Simply get the pathname using plain old javascript location If you want to get just the last part you can use location.pathname replace the bit required

var href = location.href;
href.replace("radiofr/my", "radiofr/intranet/_layouts/rf.portal.web");

Note : grabbed the url with javascript as not entirely sure what the purpose of this action is and whether the url is a known string at that point

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.