sebarmeli/JAIL — Issue #22: How to use JAIL on ajax pages?
Author: ChristianSeel
Created: 2011-11-13 20:06:38+00:00
State: open

Hey,

I have a website with some ajax content. The content of the main page and the content loaded via ajax contains images where a want to use jail for loading.

So in the main page I call JAIL
```$('img.lazy').jail({effect:"fadeIn"});```

and after loading each ajax content inside the main page, I call JAIL again in this way:
```$('img.lazy').jail({effect:"fadeIn"});```

Is this the right way it should be called again?

If I do so, I get a lot of these errors (after loading content via ajax):

```Uncaught TypeError: Cannot read property '0' of undefined
a.asynchImageLoader.a.jail._isInTheScreen - scripts.20111104.js:172
a.asynchImageLoader.a.jail._loadImageIfVisible - scripts.20111104.js:172
e - scripts.20111104.js:172
e.extend.each - jquery.min.js:2
e.fn.e.each - jquery.min.js:2
a.asynchImageLoader.a.jail._bufferedEventListener - scripts.20111104.js:172```
(jQuery 1.6.4)