51 users online (0 members and 51 guests)  


  Results 1 to 7 of 7

Related

  1. Opening a new window    Forum: HTML Forum
    Replies: 12
  2. Opening New Window    Forum: Javascript Forum
    Replies: 9
  3. Child Opening Question    Forum: Javascript Forum
    Replies: 0
  4. Replies: 2
  5. Page opening in new window - Help    Forum: HTML Forum
    Replies: 7
  1. #1
    wcipolli's Avatar
    Junior Member

    Status
    Offline
    Join Date
    Jun 2009
    Posts
    28

    Opening a word document

    I use the following function to open a word document. When I click the link it invokes the script. It opens a new blank window then the mini download window. My Question here would be how to get just the download window to show up without the blank window.

    i tried using window.opener and window.navigate neither worked


    Code:
    function openPDFWord(thisObj, pdfURL) {
    //For Opening PDF and Word
    formTitleId = thisObj.id.substr(0,thisObj.id.lastIndexOf(':')) + ":hiddenFormTitle";
    formTitle = document.getElementById(formTitleId).value;
    globalHTML="<html><head><title>" + formTitle + "</title></head>"
    		+"<frameset><frame src='" + pdfURL + "'></frame>"
    		+"</frameset></html>";
    window.open("javascript:opener.globalHTML","_blank","resizable=yes,menubar=yes,toolbar=no");

  2. #2
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    Re: Opening a word document

    Instead of using window.open, use
    Code:
    window.location "javascript:opener.globalHTML"

  3. #3
    wcipolli's Avatar
    Junior Member

    Status
    Offline
    Join Date
    Jun 2009
    Posts
    28

    Re: Opening a word document

    Code:
    <html><head><title>CGLC Form</title></head><frameset><frame src='/forms/servlet/pdf/PDFServlet?wordObjectId={D28744CB-1F51-44A0-9E67-0C268AA2EDEA}'></frame></frameset></html>
    .location didn't open anything: i put an alert in to see what the globalHTML was, maybe that'll help?

  4. #4
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    Re: Opening a word document

    Try:
    Code:
    window.location = pdfURL

  5. #5
    wcipolli's Avatar
    Junior Member

    Status
    Offline
    Join Date
    Jun 2009
    Posts
    28

    Re: Opening a word document

    Thanks! Still needs some debugging in the program but it works!

  6. #6
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    Re: Opening a word document

    Glad to hear it is working. Woohoo!

  7. #7
    wcipolli's Avatar
    Junior Member

    Status
    Offline
    Join Date
    Jun 2009
    Posts
    28

    Re: Opening a word document

    hey, is there anyway to control the title of the word document? Right now it just opens and has the servlet name as the title.



Tags for this Thread