The issue I am having is when I try to do something like the below code, the window will be blocked by pop-up blockers. I am using getScript so that I can make cross domain
You can't avoid popup blockers, and let us all give thanks for that.
When your code opens a window from some event loop that's not the direct result of user action (mostly that means a "click" event), the browser assumes that the user should have a choice of whether to see the new window.
In the case of something like your "getScript", the handler that's called when the script has been gotten is in one of those kinds of non-user event loops, so the blocker rules apply.
You could, perhaps, run your "getScript" code from your new window. The browser will allow the window to be opened from that "click" handler.
Ok, it looks like I finally figured out how to do what I was trying to do.
This way allows me to do the pop-up with out the need for an intermediate page that handles the javascript.
var newWin;
$(document).ready(function(){
$(".popup").click(function(){
newWin = window.open();
$.getScript("URL_To_A_Javascript_File", function() {
newWin.location = "DynamicURL";
});
return false;
});
});
Simply don't work with popup, use something like Lightbox instead.