title: Phonegap ios : Initailly load camera into a div
body: <p>I am developing a phonegap ios application. I need camera to be on initially when page is loaded. </p>
  
  <p>Now on clicking the div, camera is loaded in a new screen with two buttons "retake" and "use".if click on "use" button then the captured snap will be appended to img with id "preview"</p>
  
  <p>code is,</p>
  
  <pre><code>function onCamera() {
     navigator.camera.getPicture(uploadPhoto, function(message) {
         alert('get picture failed');
     },{
         quality: 50,
         destinationType: navigator.camera.DestinationType.FILE_URI,
         sourceType: Camera.PictureSourceType.CAMERA
      });      
  }
  
  function uploadPhoto(imageURI) {       
     $("#preview").attr({
         src: imageURI,
         title: "cam",
         alt: "cam image"                     
     });          
  }
  
  
  &lt;div onclick="onCamera()"&gt;
      &lt;img src="Images/camera.png" style="width:50px; height:50px;"/&gt;
  &lt;/div&gt;
  
  &lt;div class="cam"&gt;
      &lt;img id="preview" src="css/empty.png" style="width:100%; height:300px;"  /&gt;                
  &lt;/div&gt; 
  </code></pre>
  
  <p>How can i make the camera load to div with id "preview" when the page is loaded initially?</p>
  
  <p>Please Help, Thanks.</p>