I have code like this:
$scope.viewOrderDetails = function viewOrderDetails(detail) {
var newWin = open('orderdetails.html','windowName','height=300,width=300');
newWin.document.write('html to write...');
newWin.document.write(detail);
//<input type="button" value="Close this window" onclick="self.close()">
}
I want to add close button to newWin. How can I achieve that? Thanks.
UPDATED:
newWin.document.write('<input type="button" value="Close this window" onclick="window.close()">');
it works in ionic serve, but when running in my pad device, when i click "Close this window", the window can not be closed.
The answer is in your question itself...you can try this...
newWin.document.write('<input type="button" value="Close this window" onclick="window.close()">');
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