Advertisement
Guest User

Untitled

a guest
Dec 10th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function calculate() {
  2.         var period = $('#h1').val();
  3.         var amount = $('#h2').val();
  4.  
  5.         $.post({
  6.             url: '@Url.Action("GetPrices", "Dashboard")',
  7.             type: "POST",
  8.             dataType: "json",
  9.             contentType: 'application/json; charset=utf-8',
  10.             cache:false,
  11.             data: JSON.stringify({ pe: period, am: amount }),
  12.             success: function (response) {
  13.  
  14.                 var values = JSON.parse(response);
  15.                 $('#priceValue').html(values[0]);
  16.                 $('#lengthValue').html(values[1]);
  17.                 $('#dateValue').html(values[2]);
  18.                 $('#totalValue').html(values[3]);
  19.             },
  20.             error: function (XMLHttpRequest, textStatus, errorThrown) {
  21.                 alert(textStatus + errorThrown);
  22.             }
  23.         });
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement