gsp中js为@H_404_1@
$.post("modifyRight",//用../..路径不正确 {"repoName":repoName},function(data,state){ alert("state="+state) alert(data.result.repoRight); },"json");
或者@H_404_1@
$.ajax({ url: 'modifyRight',data: { repoName: repoName },success: function(data,status,xhr) { var responseJson = data; typeAheadSource = responseJson.result.repositories; },error: function(xhr,error) { } });
def modifyRight(){ String repoName = params['repoName'] render(contentType: "text/json") { result(repoRight:"后台测试") }原文链接:https://www.f2er.com/ajax/162016.html