首页 文章

bootstrap wysihtml5在IE9中不起作用

提问于
浏览
2

在rails 3.2.9中,我使用bootstrap的wysihtml5编辑器到一个textarea字段但在IE9中我没有得到该字段的(textarea)值 . 我正在通过ajax加载表单,以便在保存之前预览此文本字段的详细信息 . 在IE-10中它工作正常 .

在application.js中

//= require bootstrap-wysihtml5

在application.css中

*= require bootstrap-wysihtml5

在序列化表单时,我没有得到文本字段的值

form_data = jQuery("#form_id").serialize();
jQuery.ajax({type :'POST', url : '/user/preview.js?', data : form_data});

在观点中,

<%= f.input :description, :as=>:text, :label =>false, :required => false, :placeholder=>"Description", :input_html=>{:rows=>"10", :class=>"texteditor", :style=>"width: 520px;"} %>

在脚本中,

function loadTextEditor(){
   $('.texteditor').wysihtml5();
}
window.onload = loadTextEditor();

在通过ajax保存之前,我如何获得texteditor的 Value . 请帮我解决这个问题 .

2 回答

  • 0

    您是否尝试查看 inspect element > console 上的错误?

  • 0

    始终使用编辑器对象来获取textarea的值:

    $('.texteditor').data("wysihtml5").editor.getValue();
    

相关问题