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

Fixing Frida Server “TypeError: t is not a function” on Android

Bypassing BurpSuite "Failed to connect to website:port" issue

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