Download File Using Javascript/jQuery

前端 未结 28 3503
悲&欢浪女
悲&欢浪女 2020-11-21 05:11

I have a very similar requirement specified here.

I need to have the user\'s browser start a download manually when $(\'a#someID\').click();

But

28条回答
  •  深忆病人
    2020-11-21 05:49

    Maybe just have your javascript open a page that just downloads a file, like when you drag a download link to a new tab:

    Window.open("https://www.MyServer.
    Org/downloads/ardiuno/WgiWho=?:8080")
    

    With the opened window open a download page that auto closes.

提交回复
热议问题