I'm收到此错误strace的遗漏的类型错误:无法读取属性 '子'
Uncaught TypeError: Cannot read property 'substring' of undefined
这就是我想要
http://localhost:3001/product/?id=5
获取的 “5”
值我是在Javascript中使用这种代码
var id = url.substring(url.lastIndexOf('?=') + 1);
var url = "http://localhost:3000/product/"+id;
console.log(url);
$.ajax({
url:url,
.........
});
?
ID = 5:161遗漏的类型错误:未定义
你定义'url' *** ***后,你尝试使用它... –
检查答案。组织良好,按预期工作。 –