Created
August 22, 2012 20:40
-
-
Save macdonst/3429128 to your computer and use it in GitHub Desktop.
IP Address example html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
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
Code is not working