下面是ajax代码。它有时适用于铬,有时它不起作用。有什么想法吗?
$.ajax({
type: "POST",
//prod
url: "b2c_process_function.php",
data: dataString,
timeout: 4000,
complete: function() {
number = (Math.random() + ' ').substring(2,10) + (Math.random() + ' ').substring(2,10);
window.location.href = 'thankyou.php?OID=' + number + '&from=home';
}
});
答案 0 :(得分:0)
Chnage data: dataString,
至data: {dataString:dataString}
如下:
var dataString = 'test'; // or as you like
$.ajax({
method: "POST",
//prod
url: "b2c_process_function.php",
data: {dataString:dataString},
timeout: 4000,
complete: function(data) { //success
alert(data)
number = (Math.random() + ' ').substring(2,10) + (Math.random() + ' ').substring(2,10);
window.location.href = 'thankyou.php?OID=' + number + '&from=home';
}
});