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

JS- get last URL with lastIndexOf

0 votes
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. - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.