/// <reference path="jquery-1.10.2.min.js" />
var editor;
$(function () {
    editor = CKEDITOR.replace('Clause_body', {
        filebrowserImageUploadUrl: "/ajax/Admin_AjaxUpImage.ashx?cmd=uploadImage"

    })

    $("#Clause_Btn").click(function (e) {
        e.preventDefault();
        var clause_id = $.trim($("#Clause_id").val());
        var clause_name = $.trim($("#Clause_name").val());
        var text = editor.getData();
        if (clause_name == "") {
            alert("条款名称不能为空");
            return;
        } if (text == "") {

            alert("条款内容不能为空")
            return;
        }
        else {
            $.post("/ajax/Admin_Clause.ashx", { "type": 1, "clause_id": clause_id, "clause_name": clause_name, "text": text }, function (data) {
                var data = eval('(' + data + ')');
                if (data.Success = true) {
                    alert("修改成功");

                } else {
                    alert("修改失败");
                }


            })


        }

    })

})

