i create ajax call to get data. and in success function i add window.open(), without onclick event the result of window open is incorrect. the result is window open as tab not new window. i have add name in window.open(). and the url is incorrect.
$.ajax({
data: "ticket="+invoice,
type: "POST",
url: "<?php echo base_url('controller');?>",
cache: false,
dataType:"json",
success: function(response) {
window.open(url,windowName);
} });
url in address bar of tab is controller_url "url,windowName"
in my case, correct url in address bar is http://localhost/cinema/adm/cahier/ticket/kode_ticket
it normal if i call window.open() in onclick event. what i want is open new window popup automatically after ajax success