Yes I have seen other questions about this too, but they have not helped me, so this is my code.
$("#raspe4atat_<?= $ui->item_id ?>").click(function(){
$.ajax({
url: "/raspe4atat/<?= $ui->item_id ?>",
type: "GET",
success: function(){
$.ajax({
url: "/iframe/<?= $ui->item_id ?>",
type: "GET",
success: function(r){
$("#not_enough_money_<?= $ui->item_id ?>").append(r);
setTimeout(function(){
document.getElementById('pdf_<?= $ui->item_id ?>').contentWindow.print();
//window.frames['iframe_<?= $ui->item_id ?>'].print();
}, 1000);
}
});
}
});
return false;
});
and this is the iframe:
<iframe name="iframe_<?= $ui->item_id ?>" style="position: absolute; top: -1000px;" id="pdf_<?= $ui->item_id ?>" src="<?= base_url().'pdf/'."coupon_info_".$ui->user_id.'.pdf' ?>" width="0" height="0">
</iframe>
this code works in google chrome, but in firefox it didn't.
first it creates the pdf in the server, then it generates in the page, and then it waits 1 second and then prints it, but it doesnt' work in firefox, if i discomment the commented line, then firefox asks if i want to stop more dialog windows? can you help me?