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) –