Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

JS- get last URL with lastIndexOf

0 votes
10 views
added Feb 12 in Javascript by lcjr Sergeant (2,320 points)
newsUrl = window.location.href,
newsId = newsUrl.substring(newsUrl.lastIndexOf('/') + 1);

 

Please log in or register to response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...