메뉴 건너뛰기

조회 수 32585 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
/*  SAVING, PRINTING AND PRINT PREVIEW 
   USAGE:
     <input type=button value="print preview" onclick="window.ieExecWB(7);">
     <input type=button value="page setup" onclick="window.ieExecWB(8);">
     <input type=button value="print page w Prompt" onclick="window.ieExecWB(6);">
     <input type=button value="print page w/o Prompt" onclick="window.ieExecWB(6, -1);">
     <input type=button value="Save As" onclick="saveAsMe('ww.txt');">
     <input type=button value="Save Copy" onclick="window.ieExecWB(5);"> 
*/

<script language="javascript">

// ====================================================================
// Original post: Unkown person - I lost my notes on who did this first
//                Unkown source
// Modified by:   Walter Torres <walter@torres.ws> [www.torres.ws]
//                2001/04/29
//                I found the secret to remove the prompt!
//                Original post did not have this gem to it.
//
// This accesses a built-in Windows command that can perform Magic!
// And yes, this is a Windows ONLY solution.
// In fact, it only works in IE. :(
//
// This still doesn't work with Frames!  :(
//
//          INPUT: intOLEcmd   = integer between 1 and 37, only a few 
are of use
//                 intOLEparam = parameter integer for function - 
optional
//         OUTPUT: none
//   DEPENDANCIES: none
//
//           NOTE: intOLEparam is not optional in the Object call,
//                 I just made it optional here to make life easier.
//                 All command values use '1' execept print, thus my 
reasoning.
//
//        EXAMPLE: // This prints given window/frame WITHOUT prompt!
//                 objWinName.ieExecWB(6, -1)
//
//                 // This prints given window/frame WITH prompt!
//                 objWinName.ieExecWB(6)

//                // This will display the Print Preview window
//                 objWinName.ieExecWB(7)
//
//         VALUES: intOLEcmd has these possible values
//                 OLECMDID_OPEN         = 1
//                 OLECMDID_NEW          = 2    warning, this kills IE windows!
//                 OLECMDID_SAVE         = 3
//                 OLECMDID_SAVEAS       = 4
// OLECMDID_SAVECOPYAS = 5 note: does nothing in IE
//                 OLECMDID_PRINT        = 6    note: give '-1' as param - no prompt!
//                 OLECMDID_PRINTPREVIEW = 7
//                 OLECMDID_PAGESETUP    = 8
//                          Others have no use in IE

function ieExecWB( intOLEcmd, intOLEparam )
{
// Create OLE Object
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 
CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';

// Place Object on page
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);

// if intOLEparam is not defined, set it
if ( ( ! intOLEparam ) || ( intOLEparam < -1 )  || ( 
intOLEparam > 1 ) )
intOLEparam = 1;

// Execute Object
WebBrowser1.ExecWB( intOLEcmd, intOLEparam );

// Destroy Object
WebBrowser1.outerHTML = "";
}

</script>

  1. 이메일 체크하기

    Date2014.03.01 Views5205
    Read More
  2. input에 background-image 이벤트

    Date2014.03.01 Views5356
    Read More
  3. 주민등록번호 체크

    Date2014.03.01 Views5922
    Read More
  4. 마우스대면 글자 없어지는 검색창

    Date2014.03.01 Views6226
    Read More
  5. check box 선택시 색상 변경

    Date2014.03.01 Views6494
    Read More
  6. [jQuery] 실시간 검색어 순위 순서대로 보여주기

    Date2014.03.01 Views12017
    Read More
  7. [jQuery] 상위부터 차례로 지역 선택하기

    Date2014.03.01 Views46019
    Read More
  8. [jQuery] 탭 메뉴

    Date2014.03.01 Views6399
    Read More
  9. jQuery 이미지 슬라이드 오버시 큰이미지 보여주기 소스

    Date2014.03.01 Views6975
    Read More
  10. (소스)jqury 롤오버 버튼 쉽게 만들기

    Date2014.03.01 Views5785
    Read More
  11. top 부분이 고정되는 슬라이딩 메뉴입니다

    Date2014.03.01 Views5752
    Read More
  12. [jQuery] textarea 글자수 카운트

    Date2014.03.01 Views7420
    Read More
  13. 클릭위치로 레이어 띄우기

    Date2014.03.01 Views6220
    Read More
  14. fckeditor 2.6.6 엄청 편해졌네

    Date2014.03.01 Views5403
    Read More
  15. 자바스크립트 소수점 자리수 계산

    Date2014.03.01 Views6897
    Read More
  16. div 높이 가운데정렬

    Date2014.03.01 Views5593
    Read More
  17. javascript 인쇄 미리보기, 출력, 페이지 설정 등

    Date2014.03.01 Views32585
    Read More
  18. iframe 자동 리사이즈

    Date2014.03.01 Views5992
    Read More
  19. 활용예제 : 체크박스 전체선택 전체해제 /라디오버튼

    Date2014.03.01 Views7020
    Read More
  20. 자바스크립트, javascript, 간단한 파일 확장자 검사후 retur

    Date2014.03.01 Views5434
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 13 Next
/ 13

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved