I am posting to a payment api that returns html content of a payment page where a user can select mode of payment. I want this payment page to be displayed on an iframe within the current page
<iframe name="pay-frame" src="" id="pay-frame" width="720" height="600"
style="border: none;"></iframe>
The payment page content is returned from this
$('#make-payment').click(function (e){
e.preventDefault();
$.ajax({
type : 'POST',
url : 'url',
data : postData,
dataType : 'json',
encode : true
})
.done(function(data){
// The response data is a payment page that I want displayed in an iframe
console.log(data);
})
.fail(function(data){
console.error(data);
});
});