Can I check whether the port number is existing in a given URL string or not?
Like sometimes a user can type 202.567.89.254:8088
or http://202.567.89.254:8088/
or http://202.567.89.254
.
Out of all the above options, if the port number is existing, then do nothing otherwise append 8080
by default with an end slash 8080/
.
Is it possible in JavaScript?