开发者

Save all CodeMirrors on page

How I can save() all CodeMirror开发者_StackOverflow社区 textareas on one page?


You'd have to cache all CodeMirror instances in to an array, and then loop through that array save()'ing each instance.

var CMInstances = [instance1, instance2, ..., instanceN];
for (instance in CMInstances) {
  instance.save();
}

I'd assume at some point in your script you're setting up your CodeMirror instances, so that point would be ideal to cache them.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜