Displaying a big AJAX response can cause Safari 3 and IE6 to fail: the former displays an empty view page (no result, just the title) the latter freezes.
I located the problem in ajax_view.js, line 27: the $(response.display) call fails and returns an empty result or (I suppose) just freezes.
I tried reducing the number of rows in the result and the view behaves correctly.
I found this workaround (ignore the PHP tags :)
<?php
// ajax_view.js, line 27
//var $newView = $(response.display);
//$view.replaceWith($newView);
$view.replaceWith(response.display);
//$view = $newView;
?>
but I'm sure it's going to break something as it suppress the recently introduced $newView variable.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | views-338938-4.patch | 658 bytes | plach |
Comments
Comment #1
SeanBannister commentedI'm experiencing the same problem
Comment #2
jwinton commentedSame issue with Safari 4 beta too.
Comment #3
dawehner@Plach
Could you create a patch?
Anyone else having this problem? I cannot test on safari3 here.
Comment #4
plachHere it is.
As I said before I ain't sure it won't break something, but the project where I deployed it has not been having problems for almost 1 year.
Comment #5
merlinofchaos commentedThe problem with this patch is that behaviors will not run on the new code. replaceWith won't actually change the $view object, so the behaviors code does not work right in this case. This is a bit of a conundrum. I'm not sure how to fix this right.
Comment #6
markus_petrux commentedTrying to attach behaviors to the DOM element rather than the jQuery object?
I used this method in other scenarios, also after a replaceWith() operation, and it seems to work ok.
Another option would be passing the document. If behaviors are well coded, they won't do anything to elements that have already been processed (using the 'processed' class to flag elements already processed), so I think passing the document could also be a valid approach. In that case, the change would look like this:
Comment #7
merlinofchaos commentedAs time has gone on, it's probably better to just attach behaviors to the document anyway. There are proven examples where it's problematic not to.
Let's get a patch rerolled that way, please?
Comment #8
esmerel commentedChanging to 'needs work' because merlinofchaos has requested a new patch; if there isn't one in 90ish days, the issue will be changed to "Won't fix"
Comment #9
dooug commentedSubscribing
I experienced some similar issues recently and the above patch solved the problem.
Comment #10
jenlamptonChanging to won't fix due to lack of activity.