Advertisement
guusvanwalstijn

HTML 5 app code for stackoverflow(not working)

Nov 29th, 2013
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  2. "http://www.w3.org/TR/html4/strict.dtd">
  3. <html>
  4. <head>
  5. <title>Cordova Menu Button Example</title>
  6.  
  7. <script type="text/javascript" charset="utf-8" src="cordova-1.7.0.js"></script>
  8. <script type="text/javascript" charset="utf-8">
  9.  
  10. // Call onDeviceReady when Cordova is loaded.
  11. //
  12. // At this point, the document has loaded but cordova-1.7.0.js has not.
  13. // When Cordova is loaded and talking with the native device,
  14. // it will call the event `deviceready`.
  15. //
  16. function onLoad() {
  17. document.addEventListener("deviceready", onDeviceReady, false);
  18. }
  19.  
  20. // Cordova is loaded and it is now safe to make calls Cordova methods
  21. //
  22. function onDeviceReady() {
  23. // Register the event listener
  24. document.addEventListener("menubutton", onMenuKeyDown, false);
  25. document.addEventListener("volumedownbutton", onVolumeDownKeyDown, false);
  26. document.write("<h>ondeviceready</h1>");
  27. }
  28.  
  29. // Handle the menu button
  30. //
  31. function onMenuKeyDown() {
  32. document.write("<h1>Menu</h1>");
  33. }
  34.  
  35. function onVolumeDownKeyDown() {
  36. document.write("<h1>volume</h1>");
  37. }
  38.  
  39.  
  40.  
  41. </script>
  42. </head>
  43. <body onload="onLoad()">
  44. </body>
  45. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement