次のコードを使用して、SCEditor テキストエリアから値を取得しようとしています。
var fbeschreibung = '';
$(function() {
// Replace all textarea's
// with SCEditor
$("textarea").sceditor({
plugins: "bbcode",
style: "css/style.less",
width: "100%",
toolbar:"bold,italic,underline,strike,subscript,superscript|left,center,right,justify|size,color,removeformat|bulletlist,orderedlist,horizontalrule,emoticon",
locale:"de" ,
resizeEnabled:false
});
fbeschreibung = $('textarea').sceditor('instance').val();
$('textarea').sceditor('instance').val('Hello [b]World![/b]');
});
次に、AJAX 経由で値を送信します。
$.post('saveprofile.php',
{fbeschreibung : fbeschreibung},
function (response) {
alert(response);
}
);
しかし、私はこれを機能させることができません。ドキュメントにヒントが見つかりませんでした:http://www.sceditor.com/api/sceditor/val/
私の変数fbeschreibung
は空です。私が何か間違ったことはありますか?