SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Creating JS file to be saved

    I'd like to let users save a dynamically created external JS file. Any suggestions on how it could be done?

    The only thing I can think of is creating it with perl server-side or to create it in a document to be copy-pasted, but I'd rather it in a popup which could be saved...... possible?
    Last edited by Markdidj; Jan 1, 2004 at 20:02.
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    The only way I know of not involving copy&paste requires server side scripting of some sort. Either have a script place the dynamically created script in a file on the server and let the user download that file, or send the appropriate headers for a file download and stream the outputted script.

  3. #3
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks Dan, I had a feeling it would have to be like that. A bit of a nuisance because the button will get used alot but probably only 1% is useful to me, the rest will be people experimenting. The trouble is I'm trying to make it as user friendly as possible, so copy&paste isn't such a good idea. I'll give it a go tommorrow, but for now bed beckons......6am here in the UK!!! I've got to get a TFT screen before I ruin my eyes!!! Everythings going wobbly

    Continuing here: http://www.sitepointforums.com/showthread.php?t=145586
    Last edited by Markdidj; Jan 3, 2004 at 10:23.
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •