views:

35

answers:

1

Using Rails RJS with jQuery, I have a link with an event binding on click that does ajax call with GET and returning dataType: script (with RJS providing the response).

Works the first time in Explorer, but after that, when you click the link, it tries to save the response as a file.... Any ideas how to get around this?

Only a problem in IE.

A: 

This kind of problem is typically due to issues with server settings and the HTTP headers being passed to the browser. I'd particularly ensure the server is using the correct Content-Type header for the Ajax request.

calvinf
Thanks Calvin, your answer led me to the solution which was the standard IE problem of needing a responds_to format.html before the format.js....
Gordon Isnor
Suggest that you accept/upvote calvinf's answer then
barrowc
It didn't answer my question directly. The answer was to change the respond_to settings to place HTML response first in the Rails controller action. I just appreciated that he took the time to try and offer some advice.
Gordon Isnor
Generally that's enough that the polite thing to do is accept the answer. The reason Tim and others have been commenting on your low 13% accept rate is that people will be less willing to leave even these indirect answers if you don't give credit for the help you've received. Yes, it's a bit quid pro quo, but that's the nature of politeness.
calvinf