0
我有這個jQuery應該解僱MVC函數調用,功能不是在MVC從jstree呼叫發射
$(document).ready(function() {
alert("ddddd");
$("#divJsTreeDemo").jstree({
"plugins": ["json_data"],
"json_data": {
"ajax": {
"type": "POST",
"url": "/WebTree/GetTreeNodes",
"async": true,
"contentType": "application/json; charset=utf-8",
"dataType": "json",
"data": function (node) {
return "";
},
sucess: function (retval) {
var d = "";
},
error: function (retval) {
alert(retval);
}
}
}
});
});
但我不斷收到一個錯誤說「您正在查找的資源已被刪除,有其名稱已更改,或者暫時不可用。「
當我將它發送到服務器時,我得到的json錯誤嗎?
這裏是MVC控制器,
Public Class WebTreeController
Inherits System.Web.Mvc.Controller
'
' GET: /WebTree
Function Index() As ActionResult
Return View()
End Function
Public Function GetTreeNodes() As JsonResult
Dim list As New List(Of String)
list.Add("dddd")
'Dim jsonString As String = Encoding.Default.GetString(list.ToArray)
Return Me.Json(list)
End Function
End Class
嘗試在數據中發送NULL,也請確保url正確。 –