I have HTML AngualrJS application which works as follow:
This is where controller receives transaction confirmation details from my PHP:
this.stripeResponseHandler = function (status, response) {
...
$http ({
method: 'POST',
url: 'https://server/billpay/charge.php',
data: postData
}).then (function (response) {
console.log (response.data);
that.result = response.data;
that.isSaving=1;
}, function (response) {
console.log ("failed %s", response);
that.isSaving=1;
})
Problem:
I need to replace entire existing page (with the form) to the full HTML page (with CSS, HTML, JS) returned by the server.
Server returns the receipt which user can just print for the records.
Essentially I don't want to just inject server's response to DIV (or similar) on the current page, instead entire new page needs to be re-rendered from the server response.
How would I do this?
Thanks!!
create another page with (CSS, HTML, JS) and after form submission redirect to that page with server response data.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With