2013-04-26 223 views
1

在rails 3.2.9中,我將bootstrap的wysihtml5編輯器用於一個textarea字段,但在IE9中,我沒有得到該字段的(textarea)值。我通過ajax加載一個表單,在保存之前預覽此文本字段的詳細信息。在IE-10中它工作正常。bootstrap wysihtml5不能在IE9中工作

在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保存之前獲得文本編輯的價值。請幫我解決這個問題。

回答

0

您是否試圖在inspect element > console上查看錯誤?

+0

錯誤沒有顯示 – 2013-04-26 06:21:19

+0

我認爲這對IE瀏覽器的問題..檢查了這一點: https://開頭github上。 com/jhollingworth/bootstrap-wysihtml5/issues/84 – Lian 2013-04-26 06:23:25

+0

此鏈接包含不同的問題,我的是不同的問題。 – 2013-04-26 06:33:05

0

始終使用編輯器對象來獲取textarea的值:

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