日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

ie8 ajax提交表单,IE8下 ajaxSubmit兼容问题

發布時間:2023/12/10 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ie8 ajax提交表单,IE8下 ajaxSubmit兼容问题 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

ie8下 ajaxSubmit 提交成功后返回的json數據,拿到的是當前界面的html代碼

前端form:

導入文件:

導入

導入結果:

后端:

public void ProcessRequest(HttpContext context)

{

HttpResponse response = context.Response;

response.Clear();

response.ContentType = "text/plain";

//response.ContentType = "application/json";

//response.Write("Hello World");

response.Charset = "utf-8";

response.ContentEncoding = System.Text.Encoding.UTF8;

response.AddHeader("Access-Control-Allow-Origin", "*");

response.AddHeader("Access-Control-Allow-Methods", "POST");

response.AddHeader("Access-Control-Allow-Headers", "x-requested-with,content-type");

string type = string.IsNullOrEmpty(context.Request["type"]) ? "" : context.Request["type"];

Result result = new Result();

FrockCarInterface inf = new FrockCarInterface();

switch (type)

{

case "importmodel"://導入接口

string UserID = string.IsNullOrEmpty(context.Request["emp_id"]) ? "" : context.Request["emp_id"];//獲取當前登錄用id

string names = Base.GetUserNameS(UserID);

string FileNames = string.IsNullOrEmpty(context.Request["FileNames"]) ? "" : context.Request["FileNames"];

string merge = string.IsNullOrEmpty(context.Request["merge"]) ? "" : context.Request["merge"]; ;

int rows = string.IsNullOrEmpty(context.Request["rows"]) ? 0 : Int32.Parse(context.Request["rows"]);

int tempType = string.IsNullOrEmpty(context.Request["tempType"]) ? 0 : Int32.Parse(context.Request["tempType"]);

result = inf.Import(FileNames, merge, rows, tempType, UserID, names);

break;

};

string json = JsonHelper.Json(result);

response.Write(json);

response.End();

}

導入JS:

//導入excel

$('#importGZC').click(function() {

$("#formGZC").ajaxSubmit({

type: 'post',

url: urlImport,

// dataType: 'text/html',

success: function(dsadfsad) {

alert(dsadfsad)

/* if (d) {

$('#win').dialog('close');

$.messager.alert('提示', "導入成功");

$.get(urlReturn, function(data) {

$('#GZCDetailedTab').datagrid('loadData', data.data);

});

} else {

$.messager.alert('警告', messagers.errMsg);

} */

},

error: function(d) {

$.messager.alert('錯誤', "導入錯誤");

}

})

});

頁面頭文件:

IE8

GOOGLE

總結

以上是生活随笔為你收集整理的ie8 ajax提交表单,IE8下 ajaxSubmit兼容问题的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。