This article mainly shares with you the method of dynamically exporting strings in js. I hope it can help you.
Example 1: Use blob to dynamically export strings to excel:
Document
学生信息 | |||
---|---|---|---|
名字 | 性别 | 年龄 | 班级 |
小明 | 男 | 19 | 1班 |
小黄 | 男 | 20 | 2班 |
老王 | 男 | 29 | 3班 |
总人数:3人 |
Example 2:
Note: DOM.click(); is to simulate a dom click event .
Related recommendations:
Common properties and methods of strings in JS
Detailed explanation of common string operation methods in JavaScript