【发布时间】:2019-04-13 10:48:36
【问题描述】:
我使用了来自 github gist 的代码,它允许您将单个内容保存到 VCF 文件中。
<!doctype html>
<html>
<head>
<script type="text/javascript" src="vcard2.js"></script>
</head>
<script type="text/javascript">
// From JSON
var johnSmith = {
"version": "4.0",
"n": "SMITH;John;;",
"fn": "John Smith",
"nickname":"js",
"title": "Missing man too",
"tel": [
{"value": "555-555-555", "type": "cell"}
],
"email": [
{ "value": "john.smith@work.com", "type": "work" },
{ "value": "john.smith@home.com", "type": "home" }
]
}
var link = vCard.export(johnSmith, "John Smith", false) // use parameter true to force download
document.body.appendChild(link)
</script>
</body>
</html>
这适用于作为文件的单一内容,请参阅JSfiddle。 我的问题是如何将多个内容添加到同一个 VCF 文件中。
【问题讨论】:
标签: javascript json vcf-vcard