Tell me more ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I'm using AJAX to update page content. In my page callback I have a few commands and end with ajax_render().

When I click the AJAX link from another page, the content updates, all my JS and CSS for that page are added, and everything works perfectly. However, the CSS is not being applied in IE.

It appears that the following two lines in ajax.js are causing the problem:

var new_content_wrapped = $('<div></div>').html(response.data);
var new_content = new_content_wrapped.contents();

If I hack ajax.js and change (line 519):

wrapper[method](new_content);

to:

wrapper[method](response.data);

it works!! Any ideas?

share|improve this question

1 Answer

up vote 2 down vote accepted

The solution for me was CSS aggregation in Drupal: It needs to be on to work.
When it is disabled, it uses @import, which IE does not like if that is used to append to the head. When it is enabled, it appends links instead, which then works with IE.

The same problem is described here.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.