我在我的一個項目中使用nicEditor,我想從插件中使用jQuery提交內容。這裏是我的代碼Ajax提交nicEdit
<script type="text/javascript">
bkLib.onDomLoaded(function() {
new nicEditor().panelInstance('txt1');
});
</script>
<script>
$(document).ready(function()
{
$('#submit-from').on('submit', function(e)
{
e.preventDefault();
$('#submit').attr('disabled', ''); // disable upload button
//show uploading message
$(this).ajaxSubmit({
target: '#output-login',
success: afterSuccess //call function after success
});
});
});
function afterSuccess()
{
$('#submit-from').resetForm(); // reset form
$('#submit').removeAttr('disabled'); //enable submit button
$('#loadding').html('');
}
</script>
<form id="submit-from" action="submit.php" method="post">
<input type="text" id="title" name="title" />
<textarea id="txt1" name="txt1" ></textarea>
<input type="submit" id="submit" value="Submit"/></div>
</form>
我使用
的jQuery插件來自:http://malsup.com/jquery/form/
nicEdit:http://nicedit.com/
所有做工精細,除了在nicEdit什麼都不會似乎是張貼。如果我刪除nicEdit文本區域將罰款。有人可以指出我的問題。真的很適合你的幫助。
它的工作原理精湛。 – Kavin