Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/392.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用clEditor时清除Ajax响应后的Textarea_Javascript_Jquery_Ajax_Textarea_Cleditor - Fatal编程技术网

Javascript 使用clEditor时清除Ajax响应后的Textarea

Javascript 使用clEditor时清除Ajax响应后的Textarea,javascript,jquery,ajax,textarea,cleditor,Javascript,Jquery,Ajax,Textarea,Cleditor,我正在尝试使用cleditor清除文本区域的值。但在ajax响应之后,还不清楚。我的代码如下: <link rel="stylesheet" href="cleditor/jquery.cleditor.css" /> <script src="cleditor/jquery.min.js"></script> <script src="cleditor/jquery.cleditor.min.js"></script> <scr

我正在尝试使用
cleditor
清除文本区域的值。但在ajax响应之后,还不清楚。我的代码如下:

<link rel="stylesheet" href="cleditor/jquery.cleditor.css" />
<script src="cleditor/jquery.min.js"></script>
<script src="cleditor/jquery.cleditor.min.js"></script>
<script>$(document).ready(function () { $("#desc").cleditor(); });
</script>
//Ajax Response Function
success: function(response)
    {

        $("#btnSubmit").attr('value', 'Add');
        $("#frm_data")[0].reset();
        $("#Comman").show();
   }
<label class="col-sm-2 control-label">Description:</label>
    <div class="col-sm-10">
    <textarea rows="5" cols="5" name="desc" id="desc" class="form-control"> </textarea>
    </div>

$(document).ready(函数(){$(“#desc”).cleditor();});
//Ajax响应函数
成功:功能(响应)
{
$(“#btnSubmit”).attr('value','Add');
$(“#frm_数据”)[0]。重置();
$(“#Comman”).show();
}
说明:
请让我知道我可以做些什么来清除ajax响应上的文本区域值

$("#desc").cleditor()[0].clear();

您可以通过将空值指定给textarea字段来清除textarea字段。 它的工作100%为我,我希望它也为你工作

$('#desc').val('');

为此,请尝试类似于$(“#desc”).val(“”)的内容


这里#desc是要清除的文本区域的id,.val(“”)将其值设置为“”-请注意“”之间的空格

谢谢。。我试试看。但价值不明确。如果我不使用cl编辑器,那么它的工作就很好。你能使用这个方法吗。变量编辑器=$(“#desc”).cleditor(选项)[0];编辑器.clear();未捕获引用错误:未定义选项警告类型错误:$(…).cleditor(…).clear不是函数谢谢。。我试试看。但价值不明确。如果我不使用cl编辑器,那么它将正常工作fine@Meenapatel现在检查Uncaught ReferenceError:CLEDITOR未定义Accught ReferenceError:options未定义Hi simple solution现在检查
$("#desc").val("");