You definately do NOT want to include the absolute path 'C:/' - use
relative paths, or if you absolutely want to give the full URL, then
use the format 'http://yourdomain.com/' - as the file(s) will have to
be located relative to your web root.

On Thu, Feb 21, 2008 at 9:49 PM, Peyton Todd <[EMAIL PROTECTED]> wrote:
> This one ought to be easy for someone who knows how. I want to load a pdf 
> into a web page child window. When I put the pdf on the website's directory, 
> the following code (where the function is passed a job number naming the pdf) 
> works without a hitch:
>
>  function ScannedStyle(jn){
>    jn = jn + '.pdf';
>    win=window.open(jn,'Style','width=800,height=500,resizable=yes');
>    win.focus();
>    win.moveTo(50,50);
>    }
>
>  However, in the real life situation, there will be thousands of pdf's, 
> located on an arbitrary directory elsewhere on the server. The following does 
> not work:
>
>  function ScannedStyle(jn){
>    subdir = jn.substr(0,3); //subdirectories are first 3 digits of each jobno
>    dir = 'c:/ScannedStyles/' + subdir + '/';
>    jn = dir + jn + '.pdf';
>    alert(jn); //this says e.g. 'c:/ScannedStyles/513/51310.pdf' just as it 
> should
>    win=window.open(jn,'Style','width=800,height=500,resizable=yes');
>    win.focus();
>    win.moveTo(50,50);
>    }
>
>  Firefox objects, saying 'Firefox doesn't know how to open the address 
> because the protocol (c) isn't associated with any program'.
>
>  Since it appears to be taking the 'c' drive designation as the name of a 
> protocol, that suggests that I need to specify one. However, the following 
> also does not work:
>
>  function ScannedStyle(jn){
>    subdir = jn.substr(0,3); //subdirectories are first 3 digits of each jobno
>    dir = 'file://c:/ScannedStyles/' + subdir + '/';
>    jn = dir + jn + '.pdf';
>    win=window.open(jn,'Style','width=800,height=500,resizable=yes');
>    win.focus();
>    win.moveTo(50,50);
>    }
>
>
>  What should I be doing?
>
>  Thanks for your help,
>
>  Peyton
>
>
>
>
>
>
>  -------------------------------------------------------------
>  Annual Sponsor FigLeaf Software - http://www.figleaf.com
>
>  To unsubscribe from this list, manage your profile @
>  http://www.acfug.org?fa=login.edituserform
>
>  For more info, see http://www.acfug.org/mailinglists
>  Archive @ http://www.mail-archive.com/discussion%40acfug.org/
>  List hosted by http://www.fusionlink.com
>  -------------------------------------------------------------
>
>
>
>


-------------------------------------------------------------
Annual Sponsor FigLeaf Software - http://www.figleaf.com

To unsubscribe from this list, manage your profile @ 
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------



Reply via email to