Advertisement
Guest User

Untitled

a guest
Dec 10th, 2019
114
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.                 $('#priceValue').html(response[0]);
  14.                 $('#lengthValue').html(response[1]);
  15.                 $('#dateValue').html(response[2]);
  16.                 $('#totalValue').html(response[3]);
  17.             },
  18.             error: function (XMLHttpRequest, textStatus, errorThrown) {
  19.                 alert(textStatus + errorThrown);
  20.             }
  21.         });
  22.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement