0

I'm trying to open a new tab in the current webbrowser and post some data in the same time.

I've found a lot of solution on the web and the Jquery code seems to work for all webbrowsers (Chrome, Firefox,...) except Internet Explorer.

Here is my Javascript function (with Jquery) that I use :

function openInNewTab(url, data) {
    var form = $('<form></form>');
    form.attr("method", "post");
    form.attr("action", url);
    form.attr("target", "_blank");

    var field = $('<input></input>');
    field.attr("type", "hidden");
    field.attr("name", "paramXml");
    field.attr("value", data);

    form.append(field);

    $(document.body).append(form);
    form.submit();
}

Do you see if something goes wrong ? In Internet Explorer, the tab is correctly opened bu when I see the HTTP request, I don't see the POST data in the request.

My version of IS is 11.0.96.

Thanks in advance for your help.

NicoFC34
  • 57
  • 8
  • Have you tried any suggestion on this? https://stackoverflow.com/questions/3770324/jquerys-form-submit-not-working-in-ie – Thang Pham Jul 05 '17 at 09:57
  • I've tried and it works if you stay in the same window. If I had "$(form).attr("target", "_blank")" to add a new tab in the webbrowser, it doesn't work on IE 11! This problem makes me crazy! :-) – NicoFC34 Jul 05 '17 at 12:13
  • It seems to be working on my IE 11.0.43 (latest) on Windows 10, if you don't mind to give it a try. – Thang Pham Jul 05 '17 at 14:25
  • Yes, that's very strange. I've tested on Edge and IE11 on WIndows 10 and it works too. It seems to be a problem specific to IE11.0.96 on Win 8.1. Maybe, it's a known bug by Microsoft and it will be fixed in the next release... I hope! – NicoFC34 Jul 06 '17 at 07:47
  • Thank you for your help. :) – NicoFC34 Jul 06 '17 at 07:50

0 Answers0