var p = webcam.capture();
alert("capture complete "+p); //getting true here
var img = canvas.toDataURL("image");
var item_image = img.replace(/^data:image\/(png|jpg);base64,/, "") ;
Am searching google so many websites but its not working and that code is not suitable for my requirement.