Поместите некоторый текст в niceditor

0

У меня есть простой скрипт, который помещает некоторый текст в textarea:

Javascript

<script language="javascript" type="text/javascript">
$(document).ready(function(){
  $("#add").click(function(){
      $('#comment').html('[quote] <?php echo link_to($comment->user->username, 'profile/'.$comment->user->username); ?> written: <?php echo $comment->content; ?> [/quote]');
  });
});
</script>

HTML

<textarea id="comment" name="comment"></textarea><br />

Но он работает именно тогда, когда я выключил niceditor.

Мой код niceditor:

 <script type="text/javascript">
    //<![CDATA[
            bkLib.onDomLoaded(function() { nicEditors.allTextAreas({buttonList : ['bold','italic','underline','strikeThrough','image','upload','link','unlink']} ) });

        //]]>
 </script>
Теги:
nicedit

1 ответ

0

если вы используете только php и nicedit, вы должны поместить PHP-код прямо внутри тегов

например

<textarea id="comment" name="comment"><?php echo link_to($comment->user->username, 'profile/'.$comment->user->username); ?> written: <?php echo $comment->content; ?></textarea>

Ещё вопросы

Сообщество Overcoder
Наверх
Меню