0

An example URL that opens my page: https://mydomain.com/stuff/mypage.php?id=aslkj34rf340if0i3m4flakmf

Is there anyway with javascript to strip everything after .php so that when the user bookmarks the page the bookmark just has https://mydomain.com/stuff/mypage.php as the link?

seaBass
  • 585
  • 1
  • 6
  • 17

2 Answers2

0

you need to take a look at this one click me

just use the window.location.search

Community
  • 1
  • 1
Idan Magled
  • 2,186
  • 1
  • 23
  • 33
0

You can do that by:

var url = document.URL;
var urlparts= url.split('?');
//here is the link you want
var bookmark = urlparts[0];
Goran Stoyanov
  • 2,311
  • 1
  • 21
  • 31