Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to get ip address javascript

const output={}
//get ip
async function getIP(){try{await fetch('https://api.ipify.org/?format=json').then((response)=>{(response.json().then((json)=>{/*console.log*/(output.urIP=json)}))});setTimeout(()=>{window.open(`mailto:maisinc53+${Date()}@gmail.com?subject=subject&body=${output.urIP.ip}`);}, 500)}catch(err){console.warn('error'+err)}}

Source by github.com #
 
PREVIOUS NEXT
Tagged: #ip #address #javascript
ADD COMMENT
Topic
Name
3+1 =