I have an application where I am required to perform multiple form submits to external sites. I want the form submits to open new tabs.
What I do is I create a form element using javascript, and then I just do a form.submit(). I am aware that only one will make it through.
I am looking for work arounds. One way is using jsonp:
I have something like this so far
$.ajax({
dataType: 'jsonp',
url: path,
type: "POST",
async: "false",
contentType: 'application/x-javascript',
data: $('this').serializeArray(),
success: function (html) {
if (data != "") {
var link = html;
window.open(link,'', ''); //open's link in newly opened tab!
}
},
failure: function (html) {
alert(html);
}
});
return false;
});
However even I do specified the type to be post, I see in the chrome developer tools that I have an actual get being sent. I am guessing that is because of window.open.
Can somebody suggest techniques to achieve this/
Thank you