Skip to content

Instantly share code, notes, and snippets.

@jbasinger
Created January 28, 2015 12:37
Show Gist options
  • Save jbasinger/35cc88069a077e603640 to your computer and use it in GitHub Desktop.
Save jbasinger/35cc88069a077e603640 to your computer and use it in GitHub Desktop.
Cordova Popup Fixes
<!--<script type="text/javascript" src="cordova.js"></script>-->
<script type="text/javascript">
if (navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry)/)) {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "cordova.js";
document.getElementsByTagName("body")[0].appendChild(script);
script = null;
}
</script>
if (navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry)/)) {
document.addEventListener("deviceready", onDeviceReady, false);
} else {
onDeviceReady();
}
function onDeviceReady() {
//Cordova is ready to rock
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment