Can I check if a port number exists in a given URL string or not?
How sometimes a user can type 202.567.89.254:8088or http://202.567.89.254:8088/or http://202.567.89.254.
Of all the above options, if the port number exists, then do nothing, otherwise add 8080a default with a slash 8080/.
Is this possible in JavaScript?
source
share