sceditor

wrap wysiwyg editor's iframe

狂风中的少年 提交于 2019-12-11 13:12:05
问题 I'm using sceditor in one my projects, and I need to wrap the iframe with a div . However, when I do that, the content gets erased and of course I don't know why. Can someone throw some light on why is this happening? To test this, just go http://www.sceditor.com/ and with firebug execute this in the console $(".sceditor-container iframe").wrap("<div class='some_class'></div>"); I've also tried to alter the source code with no luck. 回答1: SCE's CSS and js requires that everything is placed in

get iframe content as string

别说谁变了你拦得住时间么 提交于 2019-12-11 03:39:10
问题 I use a jquery plugin for generating rich text editor. That editor generates an structure like this: <div id="editor" ... > ... <iframe> <!DOCTYPE html> <html> <head>...</head> <body> //some important content here and I need to get them </body> </html> </iframe> </div> Now, I want to get everything inside iframe's body as an String . I tested $("#editor").contents().find("body") , but this return me an object, not string. Also tried $("#editor").contents().find("body").outerHTML , but this

jQuery plugins: apply mCustomScrollbar to SCEditor

六眼飞鱼酱① 提交于 2019-12-08 17:43:48
问题 How can I apply mCustomScrollbar to SCEditor? This is what I've tried so far: HTML <button id="btnScrollBar">Apply scrollbar</button> <textarea id="editor"></textarea> JS $("#editor").sceditor({ plugins: "xhtml", width: '100%', style: "http://www.sceditor.com/minified/jquery.sceditor.default.min.css" }); $("#btnScrollBar").click(function() { console.log("click"); $(".sceditor-container iframe").contents().find("body").mCustomScrollbar(); }); I also tried another approach, following this