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' *** ***後,你嘗試使用它... –
檢查答案。組織良好,按預期工作。 –