Opening a new browser window via .ajax
Hello all,
My current project has me working with UI dialog and I was wondering if it's possible to open a new browser window from a click of the dialog button. I have set up an ajax call to get the url but I'm not sure if this is the correct way.
- function createNewProject(irb_id){
jQuery.ui.dialog.defaults.bgiframe = true;
jQuery(function(){
jQuery('#confirmDialog').dialog({
title: 'Create New Project',
width: 225,
hide:{effect: 'blind', duration: 500},
resizable:false,
buttons:
{
'Cancel': function(){
jQuery(this).dialog('close').dialog('destroy');
},
'Create New Project': function(){
jQuery(this).dialog('destroy');
jQuery.ajax({
type:'GET',
url:'/projects/new',
data: { irb:{'irb_id':irb_id} },
DataType: 'script',
success: function(){
//redirect_to_newProject(irb_id);
jQuery(this).dialog('close').dialog('destroy');
removeRow(id);
removeProjectResults(id);
// open new browser window
},
error: function(){
alert('error');
}
}); //end ajax call
} // end of Confirm Link button
} // end buttons
}); // end jQuery dialog
}); // end jQuery function
}
Thank you for any help on this.
JohnM