Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello
i've a link for a javascript code when i call it using my
browser i get output like document.write('Something');
so what i want is saving the output of the javascript call into .txt file
how can i do that

The data inside the javascript code is changing for every request depending on the REMOTE_ADDR

Thank you

Replies are listed 'Best First'.
Re: saving output of javascript
by sh1tn (Priest) on Apr 10, 2005 at 03:23 UTC
    Perl web-programs work on server-side.
    Javascript is on client-side.
    So Perl has nothing to do with the output of js.
    Have in mind that this file will be created on the client's hard disk.
    See javascript FileSystemObject for more information.


Re: saving output of javascript
by jbrugger (Parson) on Apr 10, 2005 at 07:01 UTC
    First, is this a javascript or a perl question?, i think you might be confused.
    But to help you out of your dream : javascript can NOT write to a local harddisk (only a cookie) and that is good!.
    Only serverside javascript can write on the (server) disk

    Next, your question is not clear to me. what do you want to do? write something to the server? let perl generate some javascript according to the request it got, so it generates text files? or do you want the javascript to generate other params that should be send to te server where it generates different text files?

    anyway, perhaps read how (not) to ask a question first.

    "We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.
Re: saving output of javascript
by Joost (Canon) on Apr 10, 2005 at 10:57 UTC