I am just a beginner in Web Development. But I got encountered with a interesting problem here we go.
Problem statement:
When I click on the Paragraph tag, I am making an Ajax call and it is opening in a new window, but the response i am getting from that called URL is not getting alerted in my current window. And also i wanted to close the ajax called window. I have Simplesaml authentication code in Filename.php
My code is as below Login.html:
<p>SSO</p>
Ajax call:
$('p').on("click", function(){
var newWindow = window.open("https://example.com/Filename.php", "new window", "width=400, height=500");
$.ajax({
url: newWindow,
async:false,
success: function(res){
alert(res);
console.log(res);
newWindow.close();
}
});
})