naa. i mean the bracket is wrong. ${'img').each(function(){ alert( $(this).width() );
}); you got 3 { 2 times you open the { and one time you close it } and i guess it have to be $('img').each(... you know what i mean? On 29 Okt., 15:20, "Andy Matthews" <[EMAIL PROTECTED]> wrote: > I meant to write img. > > All that's on the page are images. For every img on the page I was trying to > alert it's width so that I could test it. To no avail though. It kept > outputting as 0. > > Regarding the 404 suggestion, these are images not under my domain. I'm > pulling in an image from a 3rd party website. > > andy > > -----Original Message----- > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On > > Behalf Of weidc > Sent: Wednesday, October 29, 2008 9:15 AM > To: jQuery (English) > Subject: [jQuery] Re: Getting width of broken image? > > hi, > > eh.. did you copy your code? 'Cause you wrote {'img'). > > On 29 Okt., 14:30, "Andy Matthews" <[EMAIL PROTECTED]> wrote: > > I'm loading in a batch of images dynamically. Some of the images might > > not exist and I'm wondering how I might test for that image using > > jQuery (1.2.6). All I really want to do is to remove that img from the > > DOM so that it doesn't show on the page. > > > I thought at first it would be simple enough to test the width of the > image. > > All the valid images should be around 600 pixels wide, whereas the > > broken image should be 30 or so. > > > I tried this: > > > ${'img').each(function(){ > > alert( $(this).width() ); > > > }); > > > But I got 0 for both a valid, and invalid, image. Anyone have any ideas? > > > andy