Get First parameter from url (JavaScript Solution)

Today i ran into problem of how to retrieve the first parameter from a url after "/".

I have designed a simple solution, you can see live demo of it here.

I am also coying the code below

var url = window.location.pathname; // returns the full URL
var splittedurl = url.split('/');
var firstparameter = splittedurl[1]; // returns first parameter after url
alert(firstparameter);

Thanks.

You can ask any question freely in comments.


Comments

Popular posts from this blog

GRANDING UTime Master - IDOR (CVE-2023-45393)

GRANDING UTime Master - Stored XSS (CVE-2023-45391)

Ericsson BSCS iX R18 Billing & Rating (ADMX, MX) - Stored XSS (CVE-2020-29144, CVE-2020-29145)