Created
October 22, 2016 02:52
-
-
Save anilmeena/394dafe124bd2a66858ab4d5a428f815 to your computer and use it in GitHub Desktop.
Avoid browser popup blockers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Pseudo code with Javascript snippets: */ | |
// Immediately create a blank popup on user action | |
var importantStuff = window.open('', '_blank'); | |
// Optional: add some "waiting" info message. Examples: | |
// a) An external HTML page: replace the above line with | |
var importantStuff = window.open('http://example.com/waiting.html', '_blank'); | |
// b) Text: add the following line below the above one: | |
importantStuff.document.write('Loading preview...'); | |
// Fill it with content when ready (when the AJAX call is returned, for instance) | |
importantStuff.location.href = 'http://www.divyanshiinfotech.com/'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment