Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Javascript help

Reply
Thread Tools

Javascript help

 
 
John Hayes
Guest
Posts: n/a
 
      09-27-2004
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").toSt ring();

}

%>

<%

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>




 
Reply With Quote
 
 
 
 
Michael Winter
Guest
Posts: n/a
 
      09-27-2004
On Mon, 27 Sep 2004 13:51:50 GMT, John Hayes <(E-Mail Removed)> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Help Help Pentax S5i Help needed (Please) The Martian Digital Photography 14 06-20-2008 07:56 AM
JavaScript or not JavaScript Mark Rae ASP .Net 36 09-09-2006 01:12 PM
href="javascript:func()" vs href="#" onclick="javascript:func()" CRON HTML 24 06-20-2006 08:05 PM
Javascript -> Applet: variable reset after method call from javascript?! mcdeveloper Java 1 06-13-2006 08:34 AM
Need your help, I am new with javascript, what do I wrong? javascript form validation suddenly doesn´t work francisco lopez Javascript 2 12-30-2004 12:18 PM



Advertisments