Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <!--
- * Please see the included README.md file for license terms and conditions.
- -->
- <head>
- <title>Blank Cordova Mobile App Project Template (Lite)</title>
- <meta http-equiv="Content-type" content="text/html; charset=utf-8">
- <!-- see http://webdesign.tutsplus.com/tutorials/htmlcss-tutorials/quick-tip-dont-forget-the-viewport-meta-tag -->
- <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
- <style>
- /* following two viewport lines are equivalent to the meta viewport statement above, needed for Windows */
- /* see http://www.quirksmode.org/blog/archives/2014/05/html5_dev_conf.html and http://dev.w3.org/csswg/css-device-adapt/ */
- @-ms-viewport { width: 100vw ; zoom: 100% ; } @viewport { width: 100vw ; zoom: 100% ; }
- @-ms-viewport { user-zoom: fixed ; } @viewport { user-zoom: fixed ; }
- </style>
- </head>
- <body>
- <p>Hello, Cordova!</p>
- <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
- <script type="text/javascript" charset="utf-8" src="contactNumber.js"></script>
- <script>
- function alertCarrier() {
- navigator.contactsPhoneNumbers.list(function(contacts) {
- alert(contacts.length + ' contacts found');
- for(var i = 0; i < contacts.length; i++) {
- alert(contacts[i].id + " - " + contacts[i].displayName);
- for(var j = 0; j < contacts[i].phoneNumbers.length; j++) {
- var phone = contacts[i].phoneNumbers[j];
- alert("===> " + phone.type + " " + phone.number + " (" + phone.normalizedNumber+ ")");
- }
- }
- }, function(error) {
- alert(error);
- });
- }
- document.addEventListener('deviceready', alertCarrier, false);
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment