Код: Выделить всё
base-url.com/resources/1Код: Выделить всё
base-url.com/resources/edit/1
Код: Выделить всё
/resourcesЯ пробовал сделать что-то вроде
Код: Выделить всё
let path = /^\D+/.exec(window.location.pathname)[0]; // string until first number
path = path.replace(/\/+$/, ''); // removes the slash at the end
Подробнее здесь: https://stackoverflow.com/questions/798 ... source-ids
Мобильная версия