Skip to main content
Bernie_Gale
Inspiring
June 29, 2020
Answered

opening pdf on same server

  • June 29, 2020
  • 2 replies
  • 707 views

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 has been closed for replies.
    Correct answer Bernie_Gale

    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
    June 29, 2020

    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

    Bernie_Gale
    Bernie_GaleAuthorCorrect answer
    Inspiring
    June 29, 2020

    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