Learn free online HTML5, javascript, and jquery Tutorials by Examples

Sunday 1 June 2014

How to get last value of the url in javascript?

--------------------------------------------------
var cur_url = window.location.href.split('/');
var id = cur_url[cur_url.length-1];
 console.log(id);

-------------------------------------------------

No comments:

Post a Comment