我有循环生成的按钮,但是每当我按下一个按钮时,JQuery函数都不起作用,我必须承认我还不擅长jQuery或AJAX。我想增加数量而不刷新页面。
hive> explain Select * from table1, table2 where table1.column1=table2.column1
and table1. Column2=table2.column2;
这是我的剧本
<?php
if(!empty($_SESSION['placed_order'])){
$total = 0;
foreach($_SESSION['placed_order'] as $keys => $values){
?>
<!-------------------------------------- QUANTITY CONTROL ----------------------------------------->
<tr>
<td id="table_content"><?php echo $values['item_name'];?></td>
<td id="table_action">
<span id="qty_display_<?php echo $values['item_name']; ?>"><?php echo $values['item_quantity'];?></span>
<input type="hidden" id="<?php echo $values['item_name'];?>" value="<?php echo $values['item_name'];?>">
<button id="btn_<?php echo $values['item_name'];?>" class="text-success" onclick="inc_qty($('#<?php echo $values['item_name'];?>').val());" value="<?php echo $values['item_name'];?>">
<span class="glyphicon glyphicon-chevron-up" style="margin-left: 10%;"></span>
</button>
<a href="" class="text-success"><span class="glyphicon glyphicon-chevron-down"></span></a>
</td>
<td id="table_content"><?php echo $values['price'];?></td>
<td id="table_content"><?php echo number_format($values['item_quantity'] * $values['price'],2); ?></td>
<td id="table_action">
<a href="prototype.php?action=delete&id=<?php echo $values['item_id'];?>"><span class="text-danger">Remove</span></a>
|
<a href="prototype.php?action=update&id=<?php echo $values['item_id'];?>"><span class="text-info">Update</span></a>
</td>
</tr>
<!------------------------------------------------------------------------------------------------->
<?php
$total = $total + ($values['item_quantity'] * $values['price']);
}
?>