实现ajax上传,想知道如何在我的代码中实现它…我已经搜索了很多上传程序,不知道如何在我的代码中实现它。
$(‘#message_form’).html(‘个人资料编辑’+ ''+‘名字:'+’姓氏:'+‘电子邮件:'+’照片:'+ ''+‘+’Gib拥有:‘+’);
MessageWindow.show();
$(".cancel").click(function() {
MessageWindow.hide();
});
$(".submit").click(function() {
ajaxFileUpload();
var dataString = $("#myform").serialize();
$.ajax({
type: "POST",
url: YAPI.baseUrl+"updateuser.php",
data: dataString,
success: function(data){
response = eval('('+data+')');
alert(response.message);
YAPI.execute({command:'getuser',userid:App.currentUser.getData('userid')},
function(response,data){
//App.currentUser.setData();
}
);
MessageWindow.hide();
}
});
return false;
});发布于 2010-09-08 20:12:15
如果可能的话,尝试使用像Uploadify这样的jQuery插件。此外,请查看以下内容以了解更多信息:
Asynchronous file upload (AJAX file upload) using jsp and javascript
https://stackoverflow.com/questions/3667354
复制相似问题