使用ajax,php和jquery将数据插入数据库时出错,适用于本地主机但在上传到服务器后会出错。
$('#sunsubmit').click(function(){
var insertedvalue = $('#sundayform').serialize();
$('form#sundayform').unbind('sunsubmit');
$.ajax({
type: "POST",
url: "routineinsert/sunday.php",
data: insertedvalue,
beforeSend: function(messageinfo){},
success: function(messageinfo){
var c = customalertbox.render("Message!!",messageinfo);
progressdiv.style.display="none";},
error: function(jqxhr) {
customalertbox.render(jqxhr.responseText);
}
});
它适用于我的计算机,但是对于服务器它甚至没有重定向到插入代码所在的星期日文件,它直接调用错误函数。
答案 0 :(得分:0)
你的成功函数似乎缺少了大括号:
success: function(messageinfo) {
应该是
success: function(messageinfo) <============
var c = customalertbox.render("Message!!",messageinfo);
progressdiv.style.display="none";
},
error: function(jqxhr) {
customalertbox.render(jqxhr.responseText);
}
如果您始终注意格式,则更容易注意到:
Option Explicit
Sub main()
Dim ENumber As Long, currVal1 As Long, i As Long, index As Long
Dim array1 As Variant, array2 As Variant
ENumber = Worksheets("Inter").Range("B1")
ReDim IndexofE1(ENumber * (ENumber - 1) / 2) As Variant
ReDim IndexofE2(ENumber * (ENumber - 1) / 2) As Variant
currVal1 = 1
index = 0
Do While currVal1 <= ENumber - 1
For i = currVal1 + 1 To ENumber
IndexofE1(index) = currVal1
IndexofE2(index) = i
index = index + 1
Next i
currVal1 = currVal1 + 1
Loop
End Sub