Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="number">
- <input type="submit" value="Обновить">
- </div>
- <div id="sum" align="center"> //див с переменной
- {$cart_content[i].cost|replace:'&':'&'}
- </div>
- $('.number').find('input').on('click',function(){
- $.ajax({
- type:'POST',
- url:'path/to/handler.php',
- dataType:'json',
- success:function(response){
- $('#sum').find('/*блок, где хранится переменная */').html(response);
- },
- error:function(response){
- alert('error, response - ' + response);
- }
- });
- });
- <?php
- $var = //тут производим выборку из БД, если нужна
- echo json_encode($var);
- ?>
Add Comment
Please, Sign In to add comment