这有效:
var editor = $("#htmlEditor").data('ejRTE');
问题是 .data('ejRTE')
做什么?
它检索属于此 html 的小部件:
<textarea id="htmlEditor" value.bind="entity.content"
ej-rte="e-width:100%"
ref="textArea"
style="height: 220px"></textarea>
如何在没有 jQuery 的情况下检索它。
最佳答案
jQuery.data() Store arbitrary data associated with the specified element and/or return the value that was set.
所以基本上,小部件在索引 ejRTE
的元素 htmlEditor
中存储一些数据,我敢打赌它是该工具使用的自定义对象。
var editor = $("#htmlEditor").data('ejRTE');
然后 editor
将保存该元素的小部件存储的对象
关于javascript - 'data()' 在 '$("#myWidget").data (`ejTE` )' 中做什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39524154/