I have set jQuery script to place CKeditor as DIV element.
Why is showing an error when I test? An error:
TypeError: a is undefined Line 322:344.
Need help.
PHP Code:
$(function()
{
Myeditor1.init();
}
);
Myeditor1 = {
init: function() {
$('#form1').html("<form><textarea id=myIdbody1></textarea></form>");
$('#form1').hide();
$('textarea#myIdbody1').ckeditor(
{
height: "500px",
toolbarStartupExpanded: true,
width: "100%"
}
);
$('#form1').hide();
window.setTimeout(function()
{
$('#form1').show();
}, 2000
);
}
};
and working HTML code:
PHP Code:
<!DOCTYPE HTML>
<html>
<head>
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta charset="UTF-8" />
<title>Custom CKEditor</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<link rel="stylesheet" href="http://cdn.ckeditor.com/4.7.0/basic/skins/moono/editor_gecko.css" type="text/css" />
</head>
<body>
<form id="form1" class="" action="" method="post" role="form">
<dl>
<div id="myIdbody1"></div>
</dl>
</form>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ckeditor/4.7.0/ckeditor.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ckeditor/4.7.0/adapters/jquery.js"></script>
<script src="js/initCKeditor1.js"></script>
</body>
</html>
CodingForums...
ما را در سایت CodingForums دنبال می کنید
برچسب : نویسنده : codingforums بازدید : 181 تاريخ : شنبه 20 خرداد 1396 ساعت: 4:51