})
function ajaxFileUpload() {
$.ajaxFileUpload
(
{
url: ‘/Home/Upload’, //用于文件上传的服务器端请求地址
secureuri: false, //一般设置为false
fileElementId: ‘file1’, //文件上传空间的id属性 <input type=”file” id=”file” name=”file” />
dataType: ‘HTML’, //返回值类型 一般设置为json
success: function (data, status) //服务器成功响应处理函数
{
alert(data);
$(“#img1”).attr(“src”, data);
if (typeof (data.error) != ‘undefined’) {
if (data.error != ”) {
alert(data.error);
} else {
alert(data.msg);
}
}










