Anchor's Download Property is not working on some pages (Gmail)?

后端 未结 2 1986
傲寒
傲寒 2021-01-05 05:22

I want to insert this HTML element in some pages:



        
2条回答
  •  北荒
    北荒 (楼主)
    2021-01-05 06:03

    In Chrome with JQuery, I try this approach:

    var dataUri = "data:application/csv;charset=utf-8,Col1%2CCol2%2CCol3%0AVal1%2CVal2%2CVal3%0AVal11%2CVal22%2CVal33%0AVal111%2CVal222%2CVal333"
    var filename = "somedata.csv"
    
    $("")[0].click();
    

    I created a temp link and trigger click event on it. but not sure if other browsers work or not.

提交回复
热议问题