I'm capturing a certain URL value through JavaScript, but I'm having difficulty at any given time. Follow the steps below.
var url = window.location.href;
var page = url.split('/');
var page = page[page.length-1];
var arrayItens = new Array();
Considering, for example, that the URL is link , when executing the above code the return will be given "current page". No news.
However, when I add parameters beyond the "current page", eg " link ", it will capture the "current.page? source = test". I need ONLY the "current page".
Does anyone know how I can do this by following the above passage?