This repository has been archived on 2023-10-28. You can view files and clone it, but cannot push or open issues or pull requests.
pwt-0x01-ng/wwwroot/js/site.js

28 lines
719 B
JavaScript
Raw Normal View History

function Buy(Product_id, urlAction, outElementId, locale) {
$.ajax({
type: "POST",
url: urlAction,
data: { Product_id: Product_id },
dataType: "text",
success: function (price_total) {
ChangeTotalPriceInformation(outElementId, locale, price_total);
},
error: function (req, status, error) {
$(outElementId).text('error during buying expensive stuff');
}
});
}
2020-10-26 21:58:35 +01:00
function ChangeTotalPriceInformation(outElementId, locale, price_total) {
$(outElementId).text(parseFloat(price_total).toLocaleString(locale,
{
style: "currency",
currency: "EUR",
minimumFractionDigits: 2,
maximumFractionDigits: 2
}));
}
function item_deletion_confirmation() {
return confirm("Delete the item?");
}