Attempting to open a PDF file from link in a distant folder.
Three files and their locations:
(letters spaced to get by forum editor)
(* instead of period)
I have no previous experience with JavaScript, copied this from a friend.
The link seems to work ok, but browser gets the wrong address,
"Firefox can't find the file at d:/k/t/down1/down2/SAMPLE.PDF"
But the file is at d:\k\t\SAMPLE.PDF
Explorer too says "This file cannot be displayed" but does not give the address.
Is it possible to open a PDF file in a distant folder from an HTML file?
Three files and their locations:
(letters spaced to get by forum editor)
(* instead of period)
Code:
d:\k\t\W E B P D F*J S j a v a s c r i p t
d:\k\t\S A M P L E*P D F P D F file
d:\k\t\down1\down2\T E S T*H T M calling file
JS content:
<SCRIPT LANGUAGE="JavaScript" SRC="..\..\WEBPDF.JS"></SCRIPT>
<a href="javascript:PDFOpen('\k\t\SAMPLE.PDF',t)">use link</a>
test.htm content:
<!-- Hide the following from other browsers
function PDFOpen(PDFURL,PDFName)
{
var HTMLname = PDFURL.substring(0,6)
var PDFOption='toolbar=no,menubar=no,status=no,scrollbars=no,resizable=no,fullscreen=yes'
PDFWin=document.open(PDFURL,HTMLname,"'"+PDFOption+"'")
PDFWin.moveTo(0,0);
PDFWin.resizeTo(screen.width,screen.height);
}
// Stop hiding JavaScript -->
I have no previous experience with JavaScript, copied this from a friend.
The link seems to work ok, but browser gets the wrong address,
"Firefox can't find the file at d:/k/t/down1/down2/SAMPLE.PDF"
But the file is at d:\k\t\SAMPLE.PDF
Explorer too says "This file cannot be displayed" but does not give the address.
Is it possible to open a PDF file in a distant folder from an HTML file?