weixin_慕虎7534723
根据入参paramName,从请求url中查找出与paramName名称匹配的请求参数的值。
比如:
假设请求的URL为“http://xxx/xxx?a=1&b=2&c=3”
则getParam("a")的返回值为“1”
yizai30
慕妹3325488
感谢,编写get方法后解决了问题
慕UI3035061
是为了之前CORS的时候发出简单请求。
慕神4116967
xhrFields:{withCredentials:true},//session跨域ajax里要加这个,前面有一节讲跨域的,跟着那个不要改动就行
qq_慕设计1278098
qq_慕斯卡5145603
可以尝试在浏览器控制台上输入data.data来检验后端是否带数据过来了
qq_慕斯卡5145603
g_itemVO是不是定义在全局了
Java攀登者
少了一步在sources获取信息成功处的打点后刷新吧,不然控制台输进去是获取不到的
慕工程1335419
问题找到了,把另一个表的id也复制到 itemmodel中了?
weixin_慕慕9502449
看下自己的前后变量名称是否一致,然后再右击页面点击检查,看看出错在哪里
weixin_慕慕9502449
function getParam(paramName) {
paramValue = "", isFound = !1;
if (this.location.search.indexOf("?") == 0 && this.location.search.indexOf("=") > 1) {
arrSource = unescape(this.location.search).substring(1, this.location.search.length).split("&"), i = 0;
while (i < arrSource.length && !isFound) arrSource[i].indexOf("=") > 0 && arrSource[i].split("=")[0].toLowerCase() == paramName.toLowerCase() && (paramValue = arrSource[i].split("=")[1], isFound = !0), i++
}
return paramValue == "" && (paramValue = null), paramValue
}
火鸡科学家
慕沐3085582
设置个断点,看下全局异常处理器那个exception是啥
慕沐3085582
慕莱坞8027329
先debug一下看看那个环节出现问题了
jerry4013
xiaobaicaisss
杭电鬼先生
同样是这个错误,
data.data
VM101:1 Uncaught ReferenceError: data is not defined
at <anonymous>:1:1
函数是照着评论区里的同学提供的copy的,代码照着老师的敲进去的。
调试界面,看到报文头有问题,id没有传进去:
Request URL:
http://localhost:8090/item/get?id=
Request Method:
GET
Status Code:
200
Remote Address:
[::1]:8090
Referrer Policy:
no-referrer-when-downgrade
精慕门4134495
function getParam(paramName) { paramValue = "", isFound = !1; if (this.location.search.indexOf("?") == 0 && this.location.search.indexOf("=") > 1) { arrSource = unescape(this.location.search).substring(1, this.location.search.length).split("&"), i = 0; while (i < arrSource.length && !isFound) arrSource[i].indexOf("=") > 0 && arrSource[i].split("=")[0].toLowerCase() == paramName.toLowerCase() && (paramValue = arrSource[i].split("=")[1], isFound = !0), i++ } return paramValue == "" && (paramValue = null), paramValue }