I'm trying to pass an id for an item to be deleted through the URL after OK is clicked in a confirmation box, however nothing happens. This does works in IE but I'd like it to work with Chrome as well.
<script>
function dltCnfrm(id)
{
var r=confirm("Delete this product?")
if (r)
{
window.location.href = "http://localhost/e-com/index.php/product/delete_item/" + id;
}
}
</script>
code inside html
foreach ($items as $res) {
$id = $res['id'];
.
.
<td><?php echo "<a href='' onclick='dltCnfrm($id)'>Delete</a>"; ?></td>
I have also tried several other methods including
location.assign();
adding return false; underneath the if statement
could someone try this using a Chrome browser? Chrome Version 24.0.1312.57 m