User-1849651236 posted
Hello,
Is there a forum here where I can ask questions about the jQuery $.post function in this script?
Thanks,
Tony
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
$("button").click(function () {
alert("Button clicked")
$.post("https://secure.chinavasion.com/api/getProductDetails.php",
{
key: "This is my key.",
currency: "USD",
model_code: "CVNZ-9470-Black-2GEN"
},
function (data, status) {
alert("Data: " + data + "\nStatus: " + status);
},
{ dataType: "json" } )
.fail(function (response) {
alert('Errorxxx: ' + response.responseText);
});
});
});
</script>
</head>
<body>
<button>Send an HTTP POST request to a page and get the result back</button>
</body>
</html>