php で kindeditor プラグインを使用する場合、js を使用してコンテンツを取得できません。

WBOY
リリース: 2016-06-23 13:23:40
オリジナル
1166 人が閲覧しました

以上です。kindeditor を Smarty プラグインにカプセル化し、<{html_kindeditor}> を使用して別のページに導入しました。

プラグイン: function.html_kindeditor.php

<?phpfunction smarty_function_html_kindeditor(){    $editor1='        <script type="text/javascript">        var editor1;		KindEditor.ready(function(K) {			var editor1 = K.create(\'textarea[name="content1"]\', {				cssPath : \'/wxy/view/plugins/code/prettify.css\',				uploadJson : \'/wxy/view/upload_json.php\',				fileManagerJson : \'/wxy/view/php/file_manager_json.php\',				allowFileManager : true			});			prettyPrint();		});	</script>		<textarea name="content1" style="width:700px;height:200px;" id="content1"></textarea>	       <input type="button" value="提交" id="subContents"/> ';    return $editor1;}
ログイン後にコピー


導入する必要がある別のテンプレートは次のとおりです: a.html
//jquery代码		$("#subContents").click(function(){			 alert("字符串长度:"+($("#content1").val()).length+"类型:"+(typeof $("#content1").val()));		});
ログイン後にコピー

文字列を入力した後、長さは 0 になり、判定は文字列になります



ディスカッションに返信 (解決策)

allowFileManager : true,						afterBlur:function(){ 							this.sync(); 						}
ログイン後にコピー
ログイン後にコピー

試してください...

allowFileManager : true,						afterBlur:function(){ 							this.sync(); 						}
ログイン後にコピー
ログイン後にコピー

試してください...


それは本当に機能します、問題は解決されました。ははは。
ソース:php.cn
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!