I am looking to open a new tab, programmatically, in the callback of a save operation. Not very different from http://jsfiddle.net/5Lwwmbq8/1/
var atag = document.createElement('a');
atag.setAttribute('href', 'https://yahoo.com');
atag.setAttribute('target', '_blank');
atag.setAttribute('id','clickdamnit');
$('#onlydiv').append(atag);
setTimeout(function() {
atag.click();
}, 3000);
If I don't put it within a callback everything works fine. But within the confines of the callback, it is blocked by a pop up blocker. Is there a way around this?
I have tried substituting the anchor tag by window.open
- same result.