Ok, so simple. I’m trying to open a printer friendly format containing the information on the page in a flat form in another window. The following works fantastic in chrome, but falls short in IE and FireFox. Meaning it will open a new tab but it never loads any content. Any thoughts on to why it would work in chrome and not firefox?
function generate_printer_friendly(){
var form = jQ('<form/>').appendTo(document);
window.open('','printer_friendly');
form.attr('action','plugins/BuildAndInstall/pages/printer_friendly.php')
.attr('target','printer_friendly')
.attr('method','post')
;
jQ('<input/>')
.attr('type','hidden')
.attr('name','bid')
.val(JSON.stringify(bid))
.appendTo(form)
;
form[0].submit();
form.remove();
}
You need to append the form to
$("body")and not todocument. Otherwise, your form will not be posted correctly.