joeyvandijk / rimg

[DEPRECATED] A responsive image solution for browsers that support mediaqueries. Pure javascript and no server-side code.
http://joeyvandijk.github.io/rimg
MIT License
294 stars 25 forks source link

Uncaught TypeError: Cannot read property '1' of undefined #3

Closed akmur closed 10 years ago

akmur commented 10 years ago

I'm getting this error:

Uncaught TypeError: Cannot read property '1' of undefined

on this line:

inspect(target.childNodes[1].children[1]);

Any help?

joeyvandijk commented 10 years ago

Could you provide an example with html code so I can understand the issue. Apparantly it cannot find any children but I tested that situation. To fix it I need more information/example to identify the cause.

Thnx! ;) Op 6 okt. 2013 03:38 schreef "Alex Muraro" notifications@github.com:

I'm getting this error:

Uncaught TypeError: Cannot read property '1' of undefined

on this line:

inspect(target.childNodes[1].children[1]);

Any help?

— Reply to this email directly or view it on GitHubhttps://github.com/joeyvandijk/rimg/issues/3 .

akmur commented 10 years ago

Sure, here you go

https://gist.github.com/akmur/b5c0c6c9c34292e4949e

Your script is in plugins.js, loaded at bottom, and it is as such

https://gist.github.com/akmur/aa7639abc1c313ff5e6f

joeyvandijk commented 10 years ago

Thank you for the example and the issue had to do with the HTML comments like

<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->

which I did not test yet. My mistake, but thank you for your example, so 0.4.0 will work (I've tested this situation now) and you will be shown your image.

If you have any questions/remarks, let me know! :)