This is a page where I am attempting to load a backup from the file system if the device cannot connect
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="css/about.css"/>
</head>
<body>
<ons-screen>
<ons-navigator title = "About">
<ons-page id="page" font-align="center">
</ons-page>
</ons-navigator>
</ons-screen>
</body>
<script type="text/javascript">
var page = document.getElementById("page");
if(navigator.connection.type != Connection.NONE){
page.innerHTML='<iframe src="http://www.website.com/about/" style="width:100%; height:100%;"></iframe>';
}else{
page.innerHTML='<iframe src="aboutBackup.html" style="width:100%; height:100%;"></iframe>';
}
</script>
</html>
I installed the plugin using the github instructions (https://github.com/apache/cordova-plugin-network-information/blob/master/doc/index.md)
I can't figure out why, but I get Uncaught TypeError: Cannot read property 'type' of undefined on line 22 where I check the connection type.