编辑器在管理页面中工作,但对于控制台中的前端,由于将内容设置为 froalafield 而出现错误
editor works in admin page but for front-end in console I get error because of setting content to froalafield
我正在使用 django-froala 编辑器 https://github.com/froala/django-froala-editor 它在管理页面中工作正常,但当我尝试在管理页面之外使用时出现错误。
我明白了
Uncaught TypeError: $(...).froalaEditor is not a function.
来自
$(function(){
$('#id_content').froalaEditor({"fileUpload": false,
"inlineMode": false, "imageUpload": false})
});
我没有写,因为它是第 3 方应用程序。发生错误是因为 $()
没有放在最后但我没有地方可以解决这个问题,因为我只是将它用作第 3 方应用程序。
我不认为你所说的代码有误。您的管理员中有类似的代码(我也使用 froala),并且有效。
你前端导入froala编辑器js文件了吗?
我正在使用 django-froala 编辑器 https://github.com/froala/django-froala-editor 它在管理页面中工作正常,但当我尝试在管理页面之外使用时出现错误。
我明白了
Uncaught TypeError: $(...).froalaEditor is not a function.
来自
$(function(){
$('#id_content').froalaEditor({"fileUpload": false,
"inlineMode": false, "imageUpload": false})
});
我没有写,因为它是第 3 方应用程序。发生错误是因为 $()
没有放在最后但我没有地方可以解决这个问题,因为我只是将它用作第 3 方应用程序。
我不认为你所说的代码有误。您的管理员中有类似的代码(我也使用 froala),并且有效。
你前端导入froala编辑器js文件了吗?