2
沒有人使用jQuery表單插件與Box.net雲存儲。目前,我正在努力使用jQuery表單插件將文件上傳到box.net。jQuery表單插入Box.net
我的Javascript代碼:
$(document).ready(function(){
jQuery('#uploadForm').ajaxForm({
beforeSubmit: function() { alert('before');},
success: function(data) { alert('success: ');},
url: 'https://upload.box.net/api/1.0/upload/token/183331021',
type: 'POST',
dataType: 'xml',
crossDomain: true
});
});
我的頁面:
<form id="uploadForm" name="uploadForm" action="" method="POST" enctype="multipart/form-data">
<label>File to upload</label>
<input type="file" size="30" name="file" id="fileToUpload"/>
<input type="text" value="hello"/>
<input type="submit" value="Upload"></input>
</form>
看來,成功的功能從來沒有得到執行,沒有任何人有什麼可能會導致此任何想法?
有沒有可以使用的錯誤回調?不介意賭博,並且你在那裏得到一個錯誤。 – 2012-01-12 08:30:06
看起來像*相同的來源政策* - AJAX不適用於外部域。你將不得不使用服務器端請求。 – 2012-01-12 08:36:38
看到[這個問題](http://stackoverflow.com/questions/5512529/upload-files-to-the-cloud-from-web-application)它證實了我以前的假設。 – 2012-01-12 08:37:59