0
我已經寫了下面的函數來調用另一個頁面,當我點擊打印按鈕。但是當我點擊打印按鈕時,它會打開當前頁面而不是我想打電話的頁面。點擊如何打開另一頁?
function printme(tripId, requestId, Ecommerce) {
//alert("print is called");
alert(tripId);
alert(requestId);
alert(Ecommerce);
window.location.href = "ViewTripConformationPrint.cshtml?";
window.print();
//workaround for Chrome bug - https://code.google.com/p/chromium/issues/detail?id=141633
if (window.stop) {
location.reload(); //triggering unload (e.g. reloading the page) makes the print dialog appear
window.stop(); //immediately stop reloading
}
return false;
}
可能重複[有沒有一種方法來改變window.location.href後有一個onload回調?](http://stackoverflow.com/questions/13811582/is-there-a-way-to-have-一個-的onload-回調之後變化的窗口,位置的HREF) –