jquery ajax does not run when data is posted to this landing page
when this page is POST'd to it does not run the jquery ajax, but when I
run this page standalone it works. Any ideas as to how to make it work
when it is called with POST data?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="./jquery/js/jquery-1.9.1.min.js"></script>
<script src="PayFast.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8">
$.ajax({
async: true,
cache: true,
datatype: "xml",
type: "POST",
tryCount: 1,
retryLimit: 3,
data: { merchantid: 'hellonestor2yz'},
url: "payment_security01.cxp"
}).done(function( xml ) {
var status = $(xml).find('status').text();
}).error(function(xhr, textStatus, errorThrown) {
if (textStatus == 'timeout') {
// alert('Connection not
established. We give in.
Sorry.');
}
});
</script>
</head>
<body>
<!--"https://www.payfast.co.za/eng/query/validate-->
<input type="hidden" name="payfast_url"
value="https://sandbox.payfast.co.za/eng/query/validate">
<input type="hidden" name="merchant_id" value="10000100">
</body>
</html>
No comments:
Post a Comment