Take a URL parameter with Jquery

Asked

Viewed 648 times

0

  • gives a balcony on this link https://stackoverflow.com/a/21903119/4551469

1 answer

1


Assuming the element you want to capture is always on final from the URL, you can do so:

var url = 'http://localhost/admin-ativo.com/public/evento/edit4/id_menu/8/id_evento/22054'.split('/');

var last = url.pop();

console.log(last); // 22054

Browser other questions tagged

You are not signed in. Login or sign up in order to post.