2011-06-17 23 views
0

在“保存”模式下使用jquery camera时,它似乎没有效果。我试图手动调用“webcam.save”中的url,它工作正常。看来,jQuery相机无法正常工作。有没有人有任何想法?保存模式下的jquery摄像机不保存文件

<!DOCTYPE html> 
<html> 
<head> 
    <title>Registration</title> 
    <script type="text/javascript" src="http://localhost/ra/js/jquery.js"></script> 
    <script type="text/javascript" src="http://localhost/ra/js/jquery.webcam/jquery.webcam.js"></script> 
</head> 
<body> 
<h1>Register</h1> 
<h4>Picture</h4> 
<div id="picture"></div> 

<input type="button" id="take_picture" value="Take Picture" /> 
</body> 
</html> 
<script type="text/javascript"> 
$("#picture").webcam({ 
     width: 320, 
     height: 240, 
     mode: "save", 
     swffile: "http://localhost/ra/js/jquery.webcam/jscam.swf", 
     onTick: function() {}, 
     onSave: function() {}, 
     onCapture: function() {}, 
     debug: function() {}, 
     onLoad: function() {} 
}); 

$("#take_picture").click(function() 
{ 
    webcam.save("http://localhost/ra/index.php/registration/do_upload_picture"); 
}); 
</script> 
+0

尝试删除您的回调定义(onTick,onSave等),因为您没有使用它们,并定义调试方法输出到控制台并查看是否提供了任何有用的消息。 – bwest

+0

试过,调试没有提供任何保存。 –

回答

1

您必须在调用webcam.save()之前调用webcam.capture()。尝试添加webcam.capture();在你的webcam.save行之前的行中,它将起作用。