In a asp.net content page I have a hyperlink and I am making call to window.print.. but its not working, not opening the print window.
any ideas why?
Thanks
解决方案
I suggest not using javascript in the href. Try this instead:
Personally, I don't like adding any inline JavaScript to my elements. So, I would do this:
CSS:
#printPage{
cursor: pointer;
}
HTML:
JavaScript:
document.getElementById('printPage').addEventListener('click', function(){
window.print();
});