Here is HTML:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *; img-src 'self' data: content:;">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<link rel="stylesheet" type="text/css" href="css/index.css">
<title>Button Test</title>
</head>
<body>
<button type="button" class="btn">Click Me!</button>
<button type="button" class="btn">Click Me too!</button>
</body>
</html
Here is JavaScript:
var app = { initialize: function() { document.addEventListener('deviceready', this.onDeviceReady.bind(this), false); document.getElementByClassName("btn").addEventListener("click", buttonController()); }, onDeviceReady: function() { this.receivedEvent('deviceready'); }, // Update DOM on a Received Event receivedEvent: function(id) { var parentElement = document.getElementById(id); var listeningElement = parentElement.querySelector('.listening'); var receivedElement = parentElement.querySelector('.received'); listeningElement.setAttribute('style', 'display:none;'); receivedElement.setAttribute('style', 'display:block;'); console.log('Received Event: ' + id); } alertDismissed: function () { } buttonController: function () { navigator.notification.alert( 'Button Pressed!', // message alertDismissed, // callback 'Title', // title 'Button Name' // buttonName ); } }; app.initialize();
--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Like that ?
--
<script src="js/index.js"></script>
<link rel="stylesheet" type="text/css" href="css/index.css">
<title>Button Test</title></head>
<body onload="app.initialize()">
Thanks a lot, but shouldn't it all be included already (I mean why they did it that way) for basic project ?
Thanks a lot, but shouldn't it all be included already (I mean why they did it that way) for basic project ?fghfdghdfgh
--
I added cordova-plugin-dialogs, then cordova run browser
Nobody is replying. Does it mean that I'm asking stupid question OR that there really strange stuff happening and nobody knows what problem is and Cordova is tricky and/or not reliable?