how to prevent tinymce from stripping the 'style' attribute from input element?

前端 未结 4 1234
陌清茗
陌清茗 2020-12-18 04:25

I have been reading the official docs and blog posts and SO for hours, certain somewhere the answer would be posted already.. but no luck.

It seems that no amount

4条回答
  •  时光取名叫无心
    2020-12-18 05:08

    you can try with an ajax request, like this

    $("#submit").click(function(e) {
        ie8SafePreventEvent(e);
        var form_data = $("#form").serialize();
        var content = $.base64.encode(tinyMCE.activeEditor.getContent());
        $.ajax({
            type: "POST",
            url: "/your/post/processor",
            data: form_data + "&coded_content=" + content,
            success: function(return_msg){
                do_something
                },
            error: function(){
                alert("Sorry, we got an error, try later");
                }
            });
        });
    

    Obviously in your controller you have to base64decode...

提交回复
热议问题