Answers for "how to get ip address and port from url in javascript"

0

how to get ip address and port from url in javascript

<script>
var url = 'http://192.168.1.52:8080/home/client.html';
var ip = url.split('/')[2].split(':')[0];
var port = url.split('/')[2].split(':')[1];
</script>
Posted by: Guest on August-05-2021

Code answers related to "how to get ip address and port from url in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language