I am currently working on an ajax call where I need to open a URL in a new tab or window. Since I'm still learning about ajax, I would greatly appreciate any help and explanation that you can provide. Below is the code snippet:
$.ajax({
url: 'membership/fetchParishionersDetails.php',
method: "POST",
data: {view:view},
type: "json",
success:function(response)
{
var x =JSON.parse(response);
$('.dropdown-menu').html(x.notification);
if(view !='')
localStorage.setItem("noteCount",0);
if(x.unseen_notification >=localStorage.getItem("noteCount")) {
if(x.unseen_notification > localStorage.getItem("noteCount")) {
if(x.unseen_notification>localStorage.getItem("noteCount")) {
var audio = new Audio('membership/sounds/beep1.wav');
audio.play();
}
localStorage.setItem("noteCount",x.unseen_notification);
$('.count').html(x.unseen_notification);
}
}
}
});
I have attempted setting the URL to open in a new tab with this code:
url: ('membership/fetchParishionersDetails.php','_blank'),
However, this approach did not yield the desired outcome.