按照图并设置 TinyMce,它让我开始使用 Tinymce 加载网站
Uncaught TypeError: o is not a constructor
更改为其他网站会抛出
TypeError: Cannot set property 'onload' of null
重定向到出错的地方
function et() {
var e = !0
, n = this;
this.debugEnabled = function(n) {
return y(n) ? (e = n,
this) : e
}
,
this.$get = ["$window", function(t) {
function l(e) {
return e instanceof Error && (e.stack ? e = e.message && e.stack.indexOf(e.message) === -1 ? "Error: " + e.message + "\n" + e.stack : e.stack : e.sourceURL && (e = e.message + "\n" + e.sourceURL + ":" + e.line)),
e
}
function i(e) {
var n = t.console || {}
, i = n[e] || n.log || p
, o = !1;
try {
o = !!i.apply
} catch (e) {}
return o ? function() {
var e = [];
return r(arguments, function(n) {
e.push(l(n))
}),
i.apply(n, e)// Errors here
}
: function(e, n) {
i(e, null == n ? "" : n)
}
}
return {
log: i("log"),
info: i("info"),
warn: i("warn"),
error: i("error"),
debug: function() {
var t = i("debug");
return function() {
e && t.apply(n, arguments)
}
}()
}
}
]
}
设置
.html
<td>
<textarea ui-tinymce='tinymceOptionsRead' ng-model='originalText' ></textarea>
</td>
.js
class HtmlvalueComponent {
constructor($scope) {
this.$scope.tinymceOptionsRead = {
menubar: false,
theme: 'modern',
plugins: '',
toolbar: false,
readonly: true,
statusbar: false,
height: 170,
};
}
因为错误日志中没有进一步的信息,并且 Google 没有给出解决方案,所以我需要帮助。
如果我在.js
中发表评论归档tinymceOptionsRead
并没有将其设置在 .html
中如<textarea ui-tinymce ng-model='originalText' ></textarea>
它仍然抛出两个错误。
如果我只评论 TinyMce
<!--textarea ui-tinymce ng-model='originalText' ></textarea-->
然后错误就消失了,所以问题就出在某个地方。
网站上的其他所有内容都可以正常工作,例如按钮、CRUD 等
我安装了最新版本:
TinyMce:4.5.2
ui-TinyMce:0.0.18
Angular :1.5.8
最佳答案
将 jquery.min.js 文件放在任何脚本上方页面的标题部分下。这个技巧对我有用。
关于javascript - 简单的 TinyMce 抛出 "o is not Constructor"和 "property onload of null",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41617815/