Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder Stooshie's Avatar
    Join Date
    Mar 2008
    Location
    Dundee, Scotland
    Posts
    380
    Thanks
    9
    Thanked 39 Times in 39 Posts

    Question open new window but download content

    I can write code to open a new window and write content into that window.
    e.g.

    Code:
    myWin = window.open('test.csv', 'myWin', '', true);
    mycontent = '< ... blah ... >';
    myWin.document.writeln(my_content);
    myWin.document.close();
    Does anyone know of a way to get the browser to download the content rather than display it, using javascript?

    Andrew.
    Regards, Stooshie
    O

  • #2
    Regular Coder
    Join Date
    Aug 2010
    Posts
    974
    Thanks
    19
    Thanked 212 Times in 210 Posts
    Quote Originally Posted by Stooshie View Post
    I can write code to open a new window and write content into that window.
    e.g.

    Code:
    myWin = window.open('test.csv', 'myWin', '', true);
    mycontent = '< ... blah ... >';
    myWin.document.writeln(my_content);
    myWin.document.close();
    Does anyone know of a way to get the browser to download the content rather than display it, using javascript?

    Andrew.
    myWin = window.open('test.csv', 'myWin', '', true);


  •  

    Tags for this Thread

    Posting Permissions

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