User:Teraom/hello.js

var myUrl = window.location.href; alert (myUrl); if (myUrl.indexOf ("User:") > 0) {		var username = "Some Username"; alert (username); var index1 = myUrl.indexOf ("User:"); var str1 = myUrl.substring (index1); //var index2 = str1.indexOf ("/"); //var username = str1.substring (0,index2); alert (str1); }