JQuery

How to set value to nicedit textarea using jQuery?

How to set value to nicedit textarea using jQuery?, someone asked me to explain?
In this example I will show you how to update the value nicedit textarea using jQuery. While clicking the button I will get the HTML output that I need to set to nicedit textarea using jQuery.

Jquery apply nicedit text html:

 <script type="text/javascript" src="//js.nicedit.com/nicEdit-latest.js"></script>
<script type="text/javascript">
 
    $(document).ready(function () {
             //<![CDATA[
        bkLib.onDomLoaded(function () {
            new nicEditor({ fullPanel: true }).panelInstance('moredetails');
            new nicEditor({ fullPanel: true }).panelInstance('txtPageCode');
        });
        //]]>
        });
 
 
  $("#btnFillGSM").click(function (e) {
            var dataObject = { url: $("#Url").val() };
            $.ajax({
                url: '/Specifications/Fill_DATA',
                data: JSON.stringify(dataObject),
                type: "POST",
                contentType: 'application/json; charset=utf-8',
                dataType: 'json',
                success: function (data) {
                    var htmlString = data.code;
 
                    //$("#moredetails").html(htmlString);
                   
                      nicEditors.findEditor("moredetails").setContent(htmlString);
                    return false;
                },
                beforeSend: function () {
                    $("#divprogress").show("fade", 500);
                },
                complete: function () {
                    $("#divprogress").hide("fade", 500);
                },
                error: function (err) {
                    alert(err.statusText);
                }
            });
        });
</script>


 


Post your comments / questions