在Golang中用gin框架,通过context.JSON传了一串JSON格式的数据,前端该怎么获取
用 jquery的$.ajax() 设置 dataType: "json"
$.ajax({ url: "url地址", type: "GET", dataType: "json", success: function (data) { console.log(data); } });
ajax请求