Не подключаются css к странице печати?
Не подключаются файлы style.css к странице печати. Т.е страница печати отображается без оформления. Полный путь к файлу прописывал. Что не так?
printOrder: function (){
var data = $(this).closest('.jqcart-checkout').prop('outerHTML');
if(!data) {
return false;
}
var win = window.open('', 'Печать заказа', 'width='+screen.width+',height='+screen.height),
cssHref = $(win.opener.document).find('link[href$="/styles.css"]').attr('href'),
d = new Date(),
curDate = ('0' + d.getDate()).slice(-2) + '-' + ('0' + (d.getMonth() + 1)).slice(-2) + '-' + d.getFullYear() + ' ' + ('0' + d.getHours()).slice(-2) + ':' + ('0' + d.getMinutes()).slice(-2) + ':' + ('0' + d.getSeconds()).slice(-2);
win.document.write('<html><head><title>Заказ ' + curDate + '</title>');
win.document.write('<link rel="stylesheet" href="/styles.css"><link rel="stylesheet" href="/main.css">');
win.document.write('</head><body >');
win.document.write(data);
win.document.write('</body></html>');
setTimeout(function(){
win.document.close(); // нужно для IE >= 10
win.focus(); // нужно для IE >= 10
win.print();
win.close();
}, 100);
return true;
},