144
rated 0 times
[
148]
[
4]
/ answers: 1 / hits: 44296
/ 12 Years ago, tue, august 14, 2012, 12:00:00
I have a button that I want to run a piece of script and then redirect, however nothing is happening
I have another page that uses similar code and that works. but this one just isn't working
Code to work:
<a href=javascript:void(0); onclick='$.get(features.php,{ cmd: confirm_order, id: <?php echo $o_id; ?>, name: <?php echo $_SESSION['user_name']; ?> email: <?php echo $_SESSION['user_email']; ?>};setTimeout(window.location.href=order.php?order_id=<?php echo $o_id;?>, 100);' class=button>
Code that already works on a different page:
<a href=javascript:void(0); onclick='$.get(features.php,{ cmd: remove, id: <?php echo $o_id; ?>, prod: <?php echo $row_prod['prod_id']; ?> });setTimeout(window.location.href=window.location.href, 100);'>
Now I know it's all to do with my setTimeout, I'm just not sure what I'm doing wrong.
EDIT
Link now:
<a href=javascript:void(0); class=button confirm>Confirm</a>
Code below the link:
<script type=text/javascript>
$('a .confirm').on('click',function(e){
$.get(features.php,{
cmd: confirm_order,
id: <?php echo $o_id; ?>,
name: <?php echo $_SESSION['user_name']; ?>,
email: <?php echo $_SESSION['user_email']; ?>
});
setTimeout(
function(){
window.location = order.php?order_id=<?php echo $o_id;?>
},
100);
});
</script>
which still isn't working, and is rendering the in the code
More From » redirect