Local file viewing

Help
wpeterso
2007-04-10
2012-11-08
  • wpeterso
    wpeterso
    2007-04-10

    I'm trying to use the Java DjVu viewer to view local files and trying to set the "data" param to a drive/directory location. Two snippets of code are below. For some reason when I use a path it doesn't work and when I use a file name WITHOUT a path (i.e., the document is in the codebase directory) it works.

    Help is much appreciated.

    ----------- WORKS -----------
    <SCRIPT LANGUAGE="JavaScript">
    function writeAppletTag() {
    document.writeln('<APPLET code="DjVuApplet.class" ');
    document.writeln('archive="javadjvu.jar" ');
    document.writeln('width="100%" ');
    document.writeln('height="100%" ');
    document.writeln('style="border:0px none;margin:0px 0px 0px 0px;width:700;height:400"> ');
    document.writeln(buildParamTag('data', 'Mom-Kyla.djvu'));
    document.writeln(buildParamTag('image','Does not support Java'));
    document.writeln(buildParamTag('cache_archive','javadjvu.jar'));
    document.writeln('</APPLET>');
    }

    function buildParamTag(name, value) {
    return '<PARAM NAME="' + name + '" VALUE="' + value + '">';
    }
    </SCRIPT>
    </HEAD>

    <BODY bgColor=#fff8dc>
    <SCRIPT LANGUAGE="JavaScript">
    writeAppletTag();
    </SCRIPT>

    -------------- DOES NOT WORK ------------------
    <SCRIPT LANGUAGE="JavaScript">
    function writeAppletTag() {
    document.writeln('<APPLET code="DjVuApplet.class" ');
    document.writeln('archive="javadjvu.jar" ');
    document.writeln('width="100%" ');
    document.writeln('height="100%" ');
    document.writeln('style="border:0px none;margin:0px 0px 0px 0px;width:700;height:400"> ');
    document.writeln(buildParamTag('data', 'c:\Mom-Kyla.djvu'));
    document.writeln(buildParamTag('image','Does not support Java'));
    document.writeln(buildParamTag('cache_archive','javadjvu.jar'));
    document.writeln('</APPLET>');
    }

    function buildParamTag(name, value) {
    return '<PARAM NAME="' + name + '" VALUE="' + value + '">';
    }
    </SCRIPT>
    </HEAD>

    <BODY bgColor=#fff8dc>
    <SCRIPT LANGUAGE="JavaScript">
    writeAppletTag();
    </SCRIPT>