把onclick='return confirm('Delete this comment?')'
似乎不工作時不會出現。確認(「信息」)在<?php ?>
-1
A
回答
1
您在單引號內使用單引號。使用雙引號來包裝你的代碼,而不是:
<a href='#' onclick="return confirm('Confirmation Message')">Link</a>
0
只是更改此代碼,它會工作。
echo "<a href='deleteCom.php?id=$commentID' onclick="return confirm('Delete this comment?')">Delete</a>";
0
您誤用了單引號和雙引號。你必須把斜線()放在引號中才能轉義。在HTML應該是這樣的:
<a href='#' onclick="return confirm('Confirmation Message')">Link</a>
注意到,單引號應插入雙引號 「」
從您的代碼中:
echo " <a href='deleteCom.php?id=$commentID' onclick='return confirm('Delete this comment?')'>Delete</a>";
它應該是:
echo "<a href=\"deleteCom.php?id={$commentID}\" onclick=\"return confirm('Delete this comment?')\">Delete</a>";
相關問題
- 1. 確認信息
- 2. 刪除Android確認信息
- 3. 從<a>在phantomjs提取信息
- 4. JS <---> PHP通信
- 5. 如何在<a>標籤內打印php信息?
- 6. PHP拋出錯誤隨機線</p> <p>錯誤信息
- 7. 如何獲取正確的信息到我的<select>與php
- 8. JQuery Ajax提交確認 - >發送詳細信息
- 9. adwords api報告<trigger>客戶信息丟失</trigger>
- 10. 如何從<select>和<option>標籤獲取信息
- 11. 使用ElementTree的找到<key><string>信息
- 12. 重新加載<p:tab>信息與<p:commandButton>行動
- 13. 獲取服務'applinks'的信息'應用ID'<<NULL>>'
- 14. Context.Track <T>信息去哪裏?
- 15. 從ElementHandle獲取類信息<TypeElement>
- 16. 信息<輸入ID =「INP」多重=「」 ...>
- 17. 確認消息之前郵寄在php
- 18. Javascript - 如何取消含有確認信息的信息表單?
- 19. 三個確認提交按鈕,其值爲確認信息
- 20. 訂單確認頁面沒有信息?
- 21. Rails取消確認信息原因
- 22. 如何避免Firefox確認信息?
- 23. 如何使i18n兼容確認信息
- 24. 提交後沒有確認信息
- 25. 關注tr行時的確認信息
- 26. 添加不同的確認信息jquery
- 27. 設計確認 - 歡迎信息
- 28. jQuery圖像刪除確認信息
- 29. 如何抑制IE9 window.close()確認信息
- 30. Windows 8.1設置 - 確認信息
我也試過在javascript中做,但結果相同 –
你正在混合報價字符的方式,將無法正常工作。 – arkascha
看看瀏覽器的JavaScript控制檯,當你點擊錨時,你可能會看到一個錯誤消息。 – arkascha