What Am I trying to do: redirection to home page and to previous page with id.
Whats going wrong: fails to work in IE (9) works on Firefox.
What I have tried:
On click events:
<input type="hidden" id="product_id" value="<?php echo $_GET['product_id']; ?>" />
<td><input type="submit" value="Update" onClick="update(); return false;" /></td>
<td><input type="submit" value="Go Back" onClick="redirect('go back'); return false;" /></td>
<td><input type="submit" value="Done" onClick="redirect('home'); return false;" /></td>
redirect function:
function redirect(redirect){
var id = $('#product_id').val();
if (redirect == "go back"){
window.location.href = 'displayProduct.php?product_id='+id;
}
else if (redirect == "home"){
window.location.href = 'index.php';
}
}
I also tried adding a alert('1'); inside the redirect function which doesn’t appear to be firing in IE.
Am I missing something..?
It is possible IE is throwing an error on this line:
Which could be preventing further execution. If you don’t already, make sure script debugging is not disabled in IE as well as show errors is turned on: