메뉴 건너뛰기

조회 수 32693 추천 수 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. Javascript - 입력받은 숫자를 순서대로 홀짝 별로 배열에 삽입하기

    Date2021.03.09 Views302
    Read More
  2. Javascript - 입력한 년, 월의 마지막 날짜 구하기

    Date2021.03.09 Views224
    Read More
  3. Javascript - 화면 캡처 후 서버에 저장하기(html2canvas 사용법, 주의사항)

    Date2021.03.09 Views2177
    Read More
  4. Javascript selectbox selected 컨트롤

    Date2018.06.21 Views10058
    Read More
  5. JavaScript 날짜관련함수

    Date2014.02.27 Views5703
    Read More
  6. Javascript 로 초성검색하기

    Date2019.01.10 Views2374
    Read More
  7. JavaScript 에서 JSON 생성

    Date2016.11.17 Views10323
    Read More
  8. javascript 에서 제공하는 3가지 종류의 팝업박스

    Date2016.09.21 Views5657
    Read More
  9. javascript 인쇄 미리보기, 출력, 페이지 설정 등

    Date2014.03.01 Views32693
    Read More
  10. JavaScript 출생년도에 따른 나이 계산 자바스크립트

    Date2018.09.28 Views3252
    Read More
  11. javascript 화면 캡쳐

    Date2016.11.17 Views9821
    Read More
  12. JDK6 (Java SE Development Kit 6)이하 버전 다운로드 주소

    Date2016.09.11 Views6165
    Read More
  13. jqgrid 이용한 그리드 활용하기

    Date2021.03.25 Views2354
    Read More
  14. jquery offset()을 이용한 부드러운 스크롤 이동

    Date2016.09.01 Views7277
    Read More
  15. jquery 기본 엘리먼트 속성제어방법

    Date2016.09.11 Views5518
    Read More
  16. jquery 메뉴 - 아래로 한번에 전체가 펼처짐

    Date2015.04.06 Views11698
    Read More
  17. jQuery 엘리먼트 선택

    Date2018.10.27 Views1732
    Read More
  18. jQuery 이미지 슬라이드 오버시 큰이미지 보여주기 소스

    Date2014.03.01 Views6975
    Read More
  19. JSON API - JSON.parse(), JSON.stringify() ( json 형태의 문자열을 JSON객체로 , JSON객체를 문자열로 )

    Date2015.06.19 Views6289
    Read More
  20. key pressing 누르거나 클릭중인 이벤트 예제

    Date2018.08.29 Views1622
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 13 Next
/ 13

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

© k2s0o1d4e0s2i1g5n. All Rights Reserved