我已經做了一些關於這個問題的研究,發現在php中使用確認框的方式之一是與JavaScript onclick()
。我有這個代碼不起作用。Javascript確認框與PHP
echo '<td class="item_unsold"><a href = "manage-products.php?prod='.$row[0].'" style="color:red" onclick="return confirm("Are you sure you want to delete this product ?")">Delete</a></td>';
我認爲這個問題是與'
和"
使用,但我不知道如何構建這個回聲。當我在confirm('Are you sure you want to delete this product')
中使用單引號時,我也遇到了錯誤。任何想法如何我可以構造這個回聲?感謝
感謝,這是它.. – dhani