Skip to content

Instantly share code, notes, and snippets.

@ptasker
Created February 5, 2016 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptasker/51d5f079df1f5f2827d4 to your computer and use it in GitHub Desktop.
Save ptasker/51d5f079df1f5f2827d4 to your computer and use it in GitHub Desktop.
window.open in a callback
//Do this first!
window.open("about:blank", "sharer");
var params = {...}
ajaxFunction(function (data) {
var url = 'http://google.ca';
//Refer to the original window here...
var w = window.open(url, 'sharer');
return (!w); // opens in new window/tab if allowed
}, params);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment