我的代码在除mozilla firefox之外的所有浏览器中都运行良好
$(document).ready(function () {
var id1 = '<%=ViewData["UserName"]%>';
var id2 = '<%=ViewData["UsrProfile"]%>';
var msg = $('#addFrnd').attr('value');
$.ajax(
{
type: "POST",
url: "/Profile/SendFriendRequest",
data: "id=" + id1 + "&id1=" + id2 + "&message=" + msg,
success: function (result) {
$('#addLineItemControlSection').jqmHide();
},
error: function (req, status, error) {
alert("Make sure that javascript is enabled on your browser");
}
});
});
答案 0 :(得分:2)
$(document).ready(function () {
var id1 = '<%=ViewData["UserName"]%>';
var id2 = '<%=ViewData["UsrProfile"]%>';
var msg = $('#addFrnd').attr('value');
$.ajax(
{
type: "POST",
url: "/Profile/SendFriendRequest",
data: {'id': id1 , 'id1': id2,'message':msg},
success: function (result) {
$('#addLineItemControlSection').jqmHide();
},
error: function (req, status, error) {
alert("Make sure that javascript is enabled on your browser");
}
});
});
旧
data: "id=" + id1 + "&id1=" + id2 + "&message=" + msg,
新
data: {'id': id1 , 'id1': id2,'message':msg},