KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I need some help here... Anyone knows how to solve this?: http://jsfiddle.net/Q3BfC/5/ When I submit a form with target="_blank" by defaults opens a new tab. But if try to do it after an ajax request, the forms opens a popup window. (function($) { jQuery(document).ready(function() { var launch = function(p_url) { var form = $('<form />').hide(); form.attr({'action': p_url, 'target': '_blank'}); form.appendTo(document.body); form.submit(); form.remove(); delete form; }; $('#normal').on('click', function() { launch('http://www.google.com'); }); $('#ajax').on('click', function() { $.ajax({ type: 'POST', url: '#', traditional: true, success: function() { launch('http://www.google.com'); } }); }); }); })(jQuery);
Tags (comma-separated)
Save Edits
Cancel