网站开发技术

记点笔记、 学点技术 欢迎交流建站技术。本站关注lamp技术

您尚未登录。

#1 2014-12-20 16:11:11

jquery
版主

uedit setContent Uncaught TypeError: ...

对uedit 执行命令 setContent 的时候,应该保证编辑器已经初始化话完毕。才可是使用。

否则给出错误提示

Uncaught TypeError: Cannot set property 'innerHTML' of undefined

正确的写法应该是 

var ue = UE.getEditor('editor');
var content =  '惺惺惜惺惺;
var type = '<?php echo $row['type']; ?>';


//  ue.setContent(content);  错误的写法

// 正确的写法
ue.ready(function () {
    ue.setContent(content);
});



<a href="http://www.ipbbs.net/viewforum.php?id=4"> jquery教程</a>

离线

页脚

Powered by FluxBB