I have this button that's supposed to open a random wikipedia page. In the codepen editor everything works fine, but when I open it full-page, the random button doens't work anymore and in the log it says 'window.open is disabled'.
Looking around I saw that it might be because I was calling the window.open inside an ajax call, which is asynchronous and therefore not allowed (Bypass popup blocker on window.open when JQuery event.preventDefault() is set) so I collect the url in the ajax call and call the window.open(url) inside the jquery .click function, but again: it works in codepen editor but not in the full-page version.
So I tried a simpler version, which still doesn't work:
$('#random').click(function() {
window.open("http://en.wikipedia.org/wiki")
})
I don't think it's a browser misconfiguration, because it wouldn't work in the editor either, and that's not the case. Tried with both chrome and FF.
Any idea or workaround?