Popup Without User Action?
Solution 1:
OUTDATED Origin resources and fiddles do not work anymore.
I figured out that there is an popup opening in chrome if you visit the Website first time (empty cache) and click somewhere on the document. After a refresh and a click on it again nothing will happen if cache wasn't removed.
So lets start the game of reverse engineering...
Took the script from http://undertexter.se/ and startet refuscation.
After a few steps I got the following code and I think this is not planned by browser manufactures to support something like this.
Now I wish you a lot of luck to use that for your own but I think it's evil.
Look on js fiddle for the result: Its the reverse of:
http://www.wigetmedia.com/tags/undertexter.se.js
Solution 2:
Tested on my own server, This opens up http://google.com in a new (standalone) window in Chromium 28 on Ubuntu 12.04. Adblock is active.
<scripttype="text/javascript">document.addEventListener('click', function() {
window.open('http://google.com','...','width=1080 height=640')
})
</script>
Solution 3:
try this using JQuery
$('#yourCotrolId').on('click', function() {
window.open('yourLink','...','width=1080 height=640')
});
Solution 4:
window.open
is blocked by modern browsers when called not in a click
event handler.
I faced this myself while using Rails' format.js
responses and wrote a small plugin that makes showing JS popups as simple as calling window.open()
:
Popup("<div>Hello world</div>").show('up')
Solution 5:
You could use the .trigger method for simulating an user action:
<a href="javascript:" onClick="window.open('example.html','example','width=200,height=200');">Click</a>
$('a').trigger('click');
Post a Comment for "Popup Without User Action?"