Javascript help

Discussion in 'Javascript' started by John Hayes, Sep 27, 2004.

  1. John Hayes

    John Hayes Guest

    Hi,

    I am a complete newbie when it comes to javascript and I need some help. Our
    web site creates a text file which I would like the system to ask the user
    what to do with, either open, save or cancel. Currently we use the code
    below but that only puts it in the browser window and for the text files
    that is fine but some of the files are csv and that won't work. If I can't
    it to ask me what to do with it, can I force it to open in a new window?

    Any and all help, ideas greatly appreciated.

    John



    <html>

    <head>

    <link href="/design1.css" type="text/css" rel="stylesheet">

    </head>

    <body>

    <%

    String FileName="";

    if (request.getParameter("FileName")!=null) {

    FileName=request.getParameter("FileName").toString();

    }

    String ReportName="Report Viewer";

    if (request.getParameter("ReportName")!=null) {

    ReportName=request.getParameter("ReportName").toString();

    }

    %>

    <%

    if (FileName.length()==0) {

    %>

    <h3>Report Viewer - No report Passed!</h3>

    <%

    }

    else

    {

    //Got a file name

    if (ReportName.length()==0) {

    out.println("<h3>Report Viewer</h3>");

    }

    else {

    out.println("<h3>" + ReportName +
    "</h3>");

    }

    %>

    [<a href="<%=FileName%>" target="_blank">Printer
    Friendly Format</a>]

    &nbsp;

    [<a href="" onclick='window.print();return false;'
    >Print This Page</a>]




    <pre>

    <jsp:include page="<%=FileName%>"/>

    </pre>

    <%

    }

    %>

    </body>

    </html>
     
    John Hayes, Sep 27, 2004
    #1
    1. Advertisements

  2. On Mon, 27 Sep 2004 13:51:50 GMT, John Hayes <> wrote:

    > I am a complete newbie when it comes to javascript and I need some help.
    > Our web site creates a text file which I would like the system to ask
    > the user what to do with, either open, save or cancel. Currently we use
    > the code below but that only puts it in the browser window and for the
    > text files that is fine but some of the files are csv and that won't
    > work. If I can't it to ask me what to do with it, can I force it to open
    > in a new window?


    A potential solution is mentioned in the group FAQ. It might also be a
    good thing for you to read as someone new to the language.

    <URL:http://jibbering.com/faq/>

    [snip]

    Good luck,
    Mike

    --
    Michael Winter
    Replace ".invalid" with ".uk" to reply by e-mail.
     
    Michael Winter, Sep 27, 2004
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?dHJlbGxvdzQyMg==?=

    HELP! HELP! HELP! Opening Web Application Project Error

    =?Utf-8?B?dHJlbGxvdzQyMg==?=, Feb 20, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    1,008
    =?Utf-8?B?dHJlbGxvdzQyMg==?=
    Feb 20, 2004
  2. Harvey
    Replies:
    0
    Views:
    1,099
    Harvey
    Jul 16, 2004
  3. Harvey
    Replies:
    1
    Views:
    1,177
    Daniel
    Jul 16, 2004
  4. =?Utf-8?B?S2ltb24gSWZhbnRpZGlz?=

    HELP - HELP - HELP

    =?Utf-8?B?S2ltb24gSWZhbnRpZGlz?=, Mar 9, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    1,006
    Eliyahu Goldin
    Mar 9, 2006
  5. Buster

    Help, Help, Help

    Buster, Oct 4, 2003, in forum: Java
    Replies:
    3
    Views:
    718
    Saager
    Oct 30, 2003
  6. Usman

    HELP HELP HELP

    Usman, Jan 22, 2004, in forum: C++
    Replies:
    7
    Views:
    516
    Usman
    Jan 23, 2004
  7. =?Utf-8?B?Q2hyaXM=?=

    Help Help. I really need some help with this

    =?Utf-8?B?Q2hyaXM=?=, Jan 31, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    887
    =?Utf-8?B?SmFzb24gVmVybWlsbGlvbg==?=
    Jan 31, 2007
  8. francisco lopez
    Replies:
    2
    Views:
    443
    Hywel Jenkins
    Dec 30, 2004
Loading...