Skip to main content
Bernie_Gale
Inspiring
Jun 29, 2020 8:37 AM UTC
Answered

opening pdf on same server

I am trying to open a pdf from within captivate in a pop up window using javascript:

window.open("https://www.xyz.co.uk/captivate/pdffiles/information.pdf","certificate","height=700,width=1024,left=25,top=25");

This works fine as a local desktop copy however, when I run this on the server it trys to open a window like this 

 https://www.xyz.co.uk/www.xyz.co.uk/captivate/pdffiles/information.pdf

which obvioulsy fails using the same code with a dummy pdf from a test site works fine on both local copy and server copy

window.open("https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf","certificate","height=700,width=1024,left=25,top=25");

 

Any help apreciated

 

Bernie

 

PS: If a captivate developer rreads this............any chance of getting a bigger window to enter code into

 

 

 

 

    This topic is closed to new replies. Start a new post to keep the conversation going.
    Bernie_Gale
    Bernie_GaleCorrect answer
    Inspiring
    Jun 29, 2020 1:02 PM UTC

    Ok,

     

    if anyone else gets stuck:

    window.open(' ../pdffiles/information.pdf', 'mywindow', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=yes,resizable=no,width=600,height=550');

     

    Works. sometimes these things get so frustating when desktop works fine but server runs differently

     

    2 replies

    kdmemory
    Inspiring
    Jun 29, 2020 1:50 PM UTC

    Hi Bernie,

    window.open() is soo 2002, if you get my drift. Before you go down that slippery slope, make sure that you read first what the MDN (Mozilla Developer Network) writes about Usablility Issues regarding opening secundary browser windows via Javascript.

    Your PS about a bigger (and better) Javascript window, I couldn't agree more!

    Klaus

    Translate
    Bernie_Gale
    Bernie_GaleAuthorCorrect answer
    Inspiring
    Jun 29, 2020 1:02 PM UTC

    Ok,

     

    if anyone else gets stuck:

    window.open(' ../pdffiles/information.pdf', 'mywindow', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=yes,resizable=no,width=600,height=550');

     

    Works. sometimes these things get so frustating when desktop works fine but server runs differently

     

    Translate