Доброго времени суток!
Good day time,
<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.9.0.custom.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.9.0.custom.min.js"></script>
<script src="/ckeditor/ckeditor.js"></script>
<script >
function red($numer){
if (!document.getElementById($numer).className){
document.getElementById($numer).className = document.getElementById($numer).className + "ckeditor";}
$( 'textarea.ckeditor' ).ckeditor();
}
</script>
...
<p onclick="red( <?php echo $row["numer"];?>)">red.</p>
...
<textarea id="<?php echo $row["numer"];?>" rows="10" cols="186" name="namenews" placeholder="Заголовок"><?php echo html_entity_decode($row["namenews"]);?></textarea>
I'm adding a class to textarea by using onclick and after that invoke CKEDITOR to replace textarea with class "ckeditor"
But nothing happend. Firebug detected a bug:
TypeError: $(...).ckeditor is not a function
$( 'textarea.editor' ).ckeditor();
How to invoke CKEDITOR for replace texarea with class="ckeditor", if the page is already loaded?
Thanks.
I solved a problem
I solved a problem
CKEDITOR.replace(document.getElementById($numer))
But
But
CKEDITOR.replaceClass = "ckeditor" doesn't work!
Can someone Help
Can someone Help on this
Today I met the same problem.
Today I met the same problem. I wasted a lot of time on it. Fortunately I solved it at last.
Did you see that you didn't import the adaptor? In addition, the order is crucial. The adaptor must be imported after the ckeditor.js and the jquery.js because it depends both of them.
Today I met the same problem.
Today I met the same problem. I wasted a lot of time on it. Fortunately I solved it at last.
Did you see that you didn't import the adaptor? In addition, the order is crucial. The adaptor must be imported after the ckeditor.js and the jquery.js because it depends both of them.