2

Using Lazybox in a Rails app to load a form over Ajax. new.js.erb looks like this:

$.lazybox('<%=j render "form" %>', {closeImg: true, speed: 100, klass: 'po_lazybox' });

and in _form.html.erb the form is being generated with a typical:

<%= form_for(@invoice, :remote => @is_remote) do |f| %>

FF, Safari, Chrome are fine with this but IE8 won't display the form in the lazybox. It seems to be related to the hidden "utf8" field because if I paste in the rendered form's HTML, minus that field, everything works.

The JS console in IE8 doesn't give any errors, just quietly displays a blank lazybox. IE8 will display the form as a plain html page, i.e. if I go to /invoices/new, everything is fine.

Any thoughts? Thanks.

4

1 に答える 1

0

フォームフィールドではありませんでした。AJAX応答のDOMコンテンツは空白行で始まり、IE8には問題があります。HTMLをいじくり回すためにコピーしたとき、空白行を削除したに違いありません。

私は愚かですが、IEにも腹を立てています。空白行の窒息はUltrixでは時代遅れだと思いました。

于 2012-10-25T15:04:20.430 に答える