title: Cordova- taking picture
body: <p>so I'm still pretty new to cordova and right now, I'm using it to make an app and I'm trying to take a picture and then save it. Right now, I can't take a picture. All I have is a button and in the corresponding javascript file, a function is called when the button is pressed. I started off by running 'cordova plugin add org.apache.cordova.camera'. This is what I tried:</p>
  
  <pre><code>document.addEventListener('deviceready', onDeviceReady);
  
  function onDeviceReady() {
  
      $('#picture').on('click',function() {
              takePicture();
      }
  
      function takePicture() {
  
          if (!navigator.camera) {
              alert("Camera API not supported", "Error");
              return;
          }
  
          navigator.camera.getPicture(function(imageURI) {
              alert("test");
          }, function(err) {
              alert("Inside err");
          }, cameraOption);
  
          /*navigator.camera.getPicture(function(imagePath) {
              alert("test");  
              document.getElementByID("photoImg").setAttribute("src", imagePath);
              alert("Got picture");
          }, function() {
              alert("Photo canceled");
          },  {
              destinationType: navigator.camera.DestinatonType.FILE_URI
          });*/
  
  
      }
  }
  </code></pre>
  
  <p>I got the function from <a href="http://learn.ionicframework.com/formulas/cordova-camera/" rel="nofollow noreferrer">http://learn.ionicframework.com/formulas/cordova-camera/</a> and I also tried the second from another place, but the camera doesn't come up in either one. Also, I inserted some alerts inside and none of them appear, so I'm a bit confused.</p>
  
  <p>Does anyone have any suggestions how I can get the camera to show up?</p>