Guest User

Untitled

a guest
Oct 27th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. <div class="number">
  2. <input type="submit" value="Обновить">
  3. </div>
  4.  
  5. <div id="sum" align="center"> //див с переменной
  6. {$cart_content[i].cost|replace:'&':'&'}
  7. </div>
  8.  
  9. $('.number').find('input').on('click',function(){
  10. $.ajax({
  11. type:'POST',
  12. url:'path/to/handler.php',
  13. dataType:'json',
  14. success:function(response){
  15. $('#sum').find('/*блок, где хранится переменная */').html(response);
  16. },
  17. error:function(response){
  18. alert('error, response - ' + response);
  19. }
  20. });
  21. });
  22.  
  23. <?php
  24. $var = //тут производим выборку из БД, если нужна
  25. echo json_encode($var);
  26. ?>
Add Comment
Please, Sign In to add comment