简体   繁体   中英

link_to :remote => :true fails in IE

I'm having a problem with remote links in IE, and I need to get it up & running soon cause the deadline is today :S The problem is that we're using AJAX to make a remote call to an action and eval the returned javascript.

When making the call using Firefox for example it's working fine, if I do it in IE, the response is made as HTML request.

IE entry in development log

Started GET "/semantic/country/5" for 127.0.0.1 at Wed Sep 07 12:06:00 +0200 2011 Processing by Semantic::SemanticController#country as HTML Parameters: {"id"=>"5"} Country Load (1.0ms) SELECT countries .* FROM countries WHERE countries . id = 5 LIMIT 1 Rendered semantic/semantic/country.js.erb (1.0ms) Completed 200 OK in 1785ms (Views: 54.0ms | ActiveRecord: 1.0ms)

Firefox call in development log

Started GET "/semantic/country/5" for 127.0.0.1 at Wed Sep 07 12:06:00 +0200 2011 Processing by Semantic::SemanticController#country as JS Parameters: {"id"=>"5"} Country Load (1.0ms) SELECT countries .* FROM countries WHERE countries . id = 5 LIMIT 1 Rendered semantic/semantic/country.js.erb (1.0ms) Completed 200 OK in 1785ms (Views: 54.0ms | ActiveRecord: 1.0ms)

The code used to generate the link is the following (in HAML):

link_to @vacancy.country.name, semantic_country_url(@vacancy.country.id), {:remote => true, :class => 'ajax'}

The problem seems to be how IE interprets the data-remote stuff in the HTML5. Is there a solution around this?

without switching to jquery , beause I cannot rewrite all the javascript in the application.

EDIT Found out that the IE browser sends the request twice now,first time a JS, which works fine, but second time as HTML.

don't run firebug AND IEdevtools at the same time...They both respond to the feedback messages and start acting weird in this case. Once I shut down Firebug IE worked fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM