I want a username from a URL like "example.com/u/AbcUser". I know we can get it by using HTTP GET request, But I want to create a regular latest site
is it possible with Vanilla JS and HTML ??
I want a username from a URL like "example.com/u/AbcUser". I know we can get it by using HTTP GET request, But I want to create a regular latest site
is it possible with Vanilla JS and HTML ??
 
    
    const url = window.location.pathname
const userName = url.split("/")[2]
 
    
        <h1 id="wel" style="text-align: center; size: 25;"> </h1>
`enter code here` function getUserName(){
    var url = location.href;
    var spliting =url.split("?");
    var splitUser = spliting[1].split("&");
    var userNam= splitUser[0].split("=");
   return document.getElementById('wel').innerHTML = "Welcome :    "+userNam[0];
    }
    getUserName();
