HTML에
function clicked(address) {
popup = window.open(); // display popup
popup.document.write(address.src); // This is where the image url goes which will just open up the image
popup.print(); // then print the image
}
뭔가를 할 수 있습니다. 당신이 볼 수 있듯이
<img src="http://budclarychevy.com/path/to/my/image.png"
width="660" height="225" alt="GM Oil Filters"
onclick="newWindow = window.open('http://budclarychevy.com/path/to/img.png');
newWindow.print();">
는 클릭에 새 창이 사진의 URL로 열립니다. 새 창 객체에 대한 참조가 있으므로 해당 객체에 'print()'함수를 호출 할 수 있습니다.
환호 답답한
정말 고마워요! 새 창에서 인쇄 대화 상자를 표시하는 방법을 알 수는 없지만 그 점은 괜찮습니다. 자바 스크립트는 전적으로 외국어입니다 ... 나는 공부해야 할 부분이 있습니다. – instamat
두 번째 생각에, 그것은 완벽하게 작동했습니다! 정확히 내가 필요로하는 것. – instamat