javascript - Getting ip address into my own code... (cordova - cordova-plugin-networkinterface) -


i'm having lot of troubles, trying ip adress variable, in javascript. function, here, work correctly: gives me alert, correct ip address.

networkinterface.getipaddress(function (ip) { alert(ip); }); 

but when try ip in order in own code (myip), can't seem working :

myip = networkinterface.getipaddress(function (ip) { return ip;} ); 

what doing wrong, here ?

all plugin things in cordova event driven. means, can't set variable do.

what have write way:

networkinterface.getipaddress(function (ip) {     // logic here } 

what can is, use triggers.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -