create .ics file on the fly using javascript or jquery?

后端 未结 5 866
花落未央
花落未央 2021-01-30 12:08

Can someone tell me if there is any jquery plugin to dynamically create .ics file with values coming from the page div values like there would be

5条回答
  •  一个人的身影
    2021-01-30 12:23

    This is an old question, but I have some ideas that could get you started (or anyone else who needs to do a similar task).

    And the JavaScript to create the file content, and open the file:

    var filedata = $('.start-time, .end-time, .Location').text();
    window.open( "data:text/calendar;charset=utf8," + escape( filedata ) );
    

    Presumably you'd want to add that code to the onclick event of a form button.

    I don't have Outlook handy, so I'm not sure if it will automatically recognize the filetype, but it might.

    Hope this helps.

提交回复
热议问题