Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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>
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript check if url ends with slash 
Javascript :: mongoose connections 
Javascript :: wait 0.5 after function javascript 
Javascript :: Extension server error: Object not found: <top, source: devtools://devtools/bundled/extensions/extensions.js (216) [9900:1226/171021.620 
Javascript :: contact form angular material 
Javascript :: javascript Display Time Every 3 Second 
Javascript :: dynamic classes in react 
Javascript :: js after settimeout 
Javascript :: createElement calls with JSX 
Javascript :: python restapi use post json 
Javascript :: if text is present make div hide 
Javascript :: callback in js 
Javascript :: react fun tion 
Javascript :: how to update json key name while keeping the values in mysql 
Javascript :: first unique character in a string javascript 
Javascript :: javascript Short and Long date format 
Javascript :: js opposite of startswith 
Javascript :: meteor create package 
Javascript :: function expression javascript 
Javascript :: update karma jasmine to specific version 
Javascript :: comments in js 
Javascript :: redirect using expressjs 
Javascript :: count number of times an element is occuring in an array in javascript 
Javascript :: jquery get data element 
Javascript :: bootstrap 4 open tab when opening modal 
Javascript :: code javascript 
Javascript :: animation end event angular 
Javascript :: jquery fedein background color 
Javascript :: react select dropdown 
Javascript :: moment js date between two dates 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =