SHARE
TWEET

Untitled

a guest Dec 10th, 2019 91 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.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top