I want to open a pdf on the same page when I click on a link generated by colissimo. (https://ws.colissimo.fr/) I want to open it on the active tab, no dialog should open. I want to do this in jquery, I tried a lot of solutions like "window.location.open" or "window.location.replace" but nothing works.
I have a link who call my function on click :
<p id="btnPrintPdf">
<a href="javascript:void(0)" onclick="showPdfEtiquetteRetour(<?php echo $order->commande_id; ?>, <?php echo $multi_transp; ?>, '<?php echo $bon_retour_numero; ?>', true)"></a>
</p>
and this is a part of my jquery function :
$.ajax({
url : path_relative_root + 'ajax_create_etiquette.php',
type : 'post',
data : data,
success : function (res) {
if ( res.substr(0,5) == 'false' ) {
alert('js_error_return_label');
} else {
if (show_pdf) {
window.open(res);
} else {
location.reload();
}
}
}
});
res is a link to the pdf