0
Good morning, everyone, I have a question. I have this URL: http://localhost/admin-active.com/public/event/edit4/id_menu/8/id_event/22054
how can I get the parameter 22054 that is in that URL and assign to a variable in Jquery ?
0
Good morning, everyone, I have a question. I have this URL: http://localhost/admin-active.com/public/event/edit4/id_menu/8/id_event/22054
how can I get the parameter 22054 that is in that URL and assign to a variable in Jquery ?
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 jquery
You are not signed in. Login or sign up in order to post.
gives a balcony on this link https://stackoverflow.com/a/21903119/4551469
– rLinhares