James
James

Reputation: 5403

Content disappearing with jquery ajax update in internet explorer

I have a form that's wrapped in a div with id content:

<div id="content">
    <%= render :partial => 'shared/signup' %>
</div>

shared/_signup.html.erb contains:

<%= form_tag sign_me_up_path, :remote => true do %>
 ...
<% end %>

If the user submits the form and there's errors, I render create.js.erb which contains only:

$("#content").html("<%= escape_javascript(render :partial => 'shared/signup') %>");

With internet explorer this simply removes all of the content in #content, but it works great in all other browsers. I'd appreciate any help / insight.

Upvotes: 3

Views: 824

Answers (2)

RSG
RSG

Reputation: 7123

I'm using the same pattern- remote form submission, javascript response which renders a partial and populates the html of a div using Jquery (1.4.4). I saw the same behavior in IE, but it turned out it was due to a typo in the HTML partial.

The other browsers were just nicer about handling an unclosed span tag. I suspect you've got a similar issue- validate the rendered HTML of your partial.

Upvotes: 2

Related Questions