[英]HTML Button onclick link not working
我在JSP頁面中使用了以下按鈕,但它給了我錯誤,並拒絕在href中打開頁面,有人可以告訴我我在這里缺少什么嗎?
<button type="button" class="btn" onclick="location.href='<%=request.getContextPath()%>/inventory/edit-product/?productid='${productinfo.id};">Edit Product</button>
謝謝你的時間
您將一個撇號放錯了位置。 它應該是
<button type="button" class="btn" onclick="location.href='<%=request.getContextPath()%>/inventory/edit-product/?productid=${productinfo.id}';">Edit Product</button>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.