Skip to content

Instantly share code, notes, and snippets.

@macdonst
Created August 22, 2012 20:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save macdonst/3429128 to your computer and use it in GitHub Desktop.
Save macdonst/3429128 to your computer and use it in GitHub Desktop.
IP Address example html
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" charset="utf-8" src="cordova.android.js"></script>
<script type="text/javascript" charset="utf-8" src="ipaddress.js"></script>
<script>
function init(){
console.log("GOT AN ONLOAD!!!")
document.addEventListener("deviceready", deviceReady, true);
}
function deviceReady() {
console.log("Device ready");
var ipAddress = cordova.require("cordova/plugin/ipaddress");
ipAddress.get(function(address) {
console.log("IP Address = " + address);
}, function() {
console.log("error");
});
}
</script>
</head>
<body onload="init();">
</body>
</html>
@NeerajSanodiya
Copy link

Code is not working

@damienwolf07
Copy link

Yeah, It uses JavaScript.

ipaddress.js

js is JavaScript. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment