We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
JS-YAML 解析器在浏览器中工作。这是一个在线演示:https://nodeca.github.io/js-yaml。不过,它的主要目标是 Node.js,而浏览器版本只是为了好玩:)
JS-YAML parser works in browser. Here is an online demonstration : https://nodeca.github.io/js-yaml. Though, it's primary goal is node.js, and browser version was done just for fun :)
这是我找到的一个。不确定这符合多少规格,但它符合我的需求。
https://github.com/jeremyfa/yaml.js
Here is one that I found. Not sure of how much of the spec this meets, but it suited my needs.
https://github.com/jeremyfa/yaml.js
很抱歉回答旧帖子,但我遇到了和你一样的问题。
可用的 javascript YAML 解析器都无法满足我的需求,因此我开发了自己的解析器:
此处提供:http://code.google.com/p/javascript-yaml -parser/
希望它对某人有帮助:)
Cumps,
迪奥戈
sorry for answering an old post, but I bumped into the same problem as you.
None of the javascript YAML parsers available satisfied my needs so I developed my own:
It is available here: http://code.google.com/p/javascript-yaml-parser/
Hope it helps somebody :)
Cumps,
Diogo
js-yaml 在 OSX 上的 Safari、Chrome 和 Firefox 中运行良好。下面是一个示例:
编辑 2024-06-25
自 ES6 (ECMAScript 2015) 起,您可以使用
fetch
使用 vanilla JS(无外部依赖项)加载 YAML 内容。js-yaml works fine in Safari, Chrome and Firefox on OSX. Here is an example :
Edit 2024-06-25
Since ES6 (ECMAScript 2015), you can load YAML content with vanilla JS (no external dependencies) with
fetch
.