Thats quite horrible!
But don't worry Bala,
    Its not a big deal and is simple. There can be 2 ways -  depends upon
whether you dont mind or do mind the page changing while saving the return
value of the function.
1) Dont Mind : This is very simple. Consider bingo() to be one function and
tringo() to be the other. You want to save the return value of tringo() to a
file. Do this :
[I dont think I need to tell you how to write the servlet in the below
example]
function bingo() {
    var content  =  escape(tringo());
    var invokeURI = http://myhost.com/servlet/SaveContent?content="; +
content;
    location.href = invokeURI;
}
function tringo() {
    ...
    return content;
}
2) Do Mind : Now there are 2 ways of doing this and it depends on which
browsers you plan to support. The first way works with all browsers, but the
second is a more elegant ( & XHTML) compatible way.

#CANCEL#     --> I just received a mail right now, saying that you are
prototyping for an EXCEL application and *many* things are now unclear. Is
this file located in the server or on the client.?  If it located on the
server, then the user *definitely* has to save the file to the server, and
there always will be a backend involved!  [ Unless you are talking about
caching some cells on the client using JavaScript and then saving the file
to the server - a sort of delayed back-end call.]
    If the file is located on the client, then HTML/JS is totally unsuitable
for this kind of work. Use a Java Application or make an application based
on the new Java Web Start.
    ...  Please be a bit more clear and list out your requirements.

Plus: netscape.javascript.JSObject class is LiveConnect technology (Java
calling JavaScript) and I dont think it works with any version of Internet
Explorer. However JavaScript to Java applet calls are possible for both
browsers.

Cheers
Tarun
----- Original Message -----
From: "Krishnamurthy, Balaji" <[EMAIL PROTECTED]>
To: "'Tarun Ramakrishna Elankath'" <[EMAIL PROTECTED]>
Sent: Wednesday, June 27, 2001 11:31 PM
Subject: RE: Saving into File


> Tarun:
>
> I can't join Yahoo because of firewall issues. Can you please (PLEASE)
show
> me how.
>
> Thanks
> Balaji
>
>
> -----Original Message-----
> From: Tarun Ramakrishna Elankath [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 27, 2001 12:52 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Saving into File
>
>
> Joint the JScript List at www.jscript.org! And then I'll show you how...
:-)
>
> Cheers,
> Tarun
>
> ----- Original Message -----
> From: "Krishnamurthy, Balaji" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, June 27, 2001 9:17 PM
> Subject: Saving into File
>
>
> > Hello:
> >
> > Is there any way we can save the return value of a Javascript function
> into
> > a file. For e.g.
> >
> > function function_that_returns_content_of_a_file()
> > {
> >         return "the contents";
> > }
> >
> > ...
> >
> > // code down here which will invoke the script and save the content on
> some
> > user action (may be button / link)
> >
> > Thanks
> > Balaji
> >
> >
>
___________________________________________________________________________
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> > of the message "signoff SERVLET-INTEREST".
> >
> > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > Resources: http://java.sun.com/products/servlet/external-resources.html
> > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
> >
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to