這是我在下面,我可以提交我的表單的唯一方法是通過瀏覽圖像。
有人可以告訴我如何提交這個按鈕,最好沒有jQuery。
我只想提交一個帶有文本的表單,沒有圖像。謝謝!phonegap表單提交wthout圖像或jquery
function browse()
{
navigator.camera.getPicture(uploadPhoto,
function(message) { alert('get picture failed'); },
{
quality: 50,
destinationType: navigator.camera.DestinationType.FILE_URI,
sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY
}
);
}
function uploadPhoto(imageURI)
{
var options = new FileUploadOptions();
options.fileKey="file";
options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);
options.mimeType="image/jpeg";
var params = {};
params.value1 = "test";
params.value2 = document.getElementById('file_name').value + "";
}
imageURI ...我可以使用應用程序內的圖像,一個像素圖像作爲URI? –
我不明白你爲什麼要提交表單到圖像的URL。 –