我有这个应该触发mvc函数调用的jquery,
$(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
答案 0 :(得分:1)
有几件事:
干杯。