How can i always read the first word for example the word ” something” after the port number using jquery/javascript?
Here is the url and i want to get whatever the first word after the port number
http://www.aaa.com:1081/something/arap/con.html
$(document).ready(function() {
var currentUrl= window.location.pathname;
alert (currentUrl);
});
Quick and dirty:
But you probably want to use something like this instead: https://github.com/allmarkedup/jQuery-URL-Parser