簡體   English   中英

firefox中的Ajax - 無法在網上找到解決方案

[英]Ajax in firefox - can't find solution on the net

這是我的js代碼:

 $(document).ready(function (e) { $("#f1").on('submit',(function(e) { var ActionType = getParameterByName('t'); var projId = getParameterByName('pj'); var QsId = getParameterByName('s'); var urlString = "uploader.php?t="; urlString +=ActionType; urlString +="&pj="; urlString +=projId; urlString +="&s="; urlString +=QsId; //e.preventDefault(); $.ajax({ url: urlString, type: "POST", data: new FormData(this), contentType: false, cache: false, processData:false, success: function(data) { //alert(callback); //Need to be changed } }); })); }); //This function gets the parameter in the URL (GET) by name function getParameterByName(name) { name = name.replace(/[\\[]/, "\\\\[").replace(/[\\]]/, "\\\\]"); var regex = new RegExp("[\\\\?&]" + name + "=([^&#]*)"), results = regex.exec(location.search); return results === null ? "" : decodeURIComponent(results[1].replace(/\\+/g, " ")); } 

螢火蟲: 錯誤Firebug

接受/接受編碼gzip,deflate Accept-Language en-US,en; q = 0.5 Content-Length 1198 Content-Type multipart / form-data; boundary = --------------------------- 266932244324698 User-Agent Mozilla / 5.0(Windows NT 6.1; WOW64; rv:30.0)Gecko / 20100101 Firefox / 30.0 X-Requested-With XMLHttpRequest

我真的無法理解這個問題。 一切在Chrome和IE中都很完美,但在FF中則不然

編輯 編輯

XHR RESPONE:

 <html> <head> <title>UPLOAD</title> <link href="styles.css" rel="stylesheet" type="text/css"> <script language="javascript" src="scripts.js"></script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script type="text/javascript" src="General.js"></script> </head> 

其余的是表等的html代碼。它是respone Header

緩存控制私有內容編碼gzip內容長度1151內容類型文本/ html日期星期四,2015年2月26日21:38:16 GMT服務器Microsoft-IIS / 7.5不同的接受編碼X-Powered-By ASP.NET X- Powered by By Plesk PleskWin

您有表單提交,並且您也有Ajax請求的競爭條件。 您需要取消表單提交。

$("#f1").on('submit', function(e) {
    e.preventDefault();
});

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM