var url = 'https://site.com/path/file.php?id=1¶m='; alert( url.substring( url.indexOf("/",8) ) );