Javascript help

J

John Hayes

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>
 
M

Michael Winter

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top