我在我的html文件中有一個textarea
,我需要將textarea
中的數據發送到數據庫。但是,textarea
發送的數據沒有enter
空格。所以這樣的數據:在CkEditor上應用jQuery函數
Shortly after reading a few books on web design, I was hooked. I wanted to know everything and anything about it. I was designing websites any chance I could.
I spent almost all of my savings buying more books on different programming languages and other nerdy computer gear.
會是這樣的數據庫。
Shortly after reading a few books on web design, I was hooked. I wanted to know everything and anything about it. I was designing websites any chance I could. I spent almost all of my savings buying more books on different programming languages and other nerdy computer gear.
所以我決定改變textarea的一個ckeditor
將數據發送爲html。但現在的問題是,我在textarea
上有一個jQuery
方法,現在它不起作用。
HTML:
<td>
<textarea maxlength="5000" id="blah" cols="100" rows="20" name="essay_content" class="ckeditor" onkeyup="words();">
</textarea></td>
的jQuery:
function words(content)
{
var f = $("#blah").val()
$('#othman').load('wordcount.php?content='+ encodeURIComponent(f));
}
現在因爲文本區域是CKEDITOR它不會和我一起工作......有什麼建議?
使用['nl2br'](http://php.net/manual/en/function.nl2br.php)與textarea。不要使用CK編輯器來解決空白問題。 – diEcho 2012-07-06 04:30:39