This has gotten so far,that I will sum up what we found out:
Inside the event handler the attribute src cannot be read in IE8 (FF works fine), neither with
children
looks for immediate child elements only where as find
looks for all the elements within it until its last child element down the dom tree. If you are saying find
is working that means the element you are looking is not its immediate children.
Try to alert this jQuery(this).children('#Image_center').length
see what you get.
FYI. Even when any element is not found jQuery will return an emtpy object it will never be null. So alert an emtpy object will always give you [object Object]
. You should alwasy check for the length
property of the jQuery object.
Try this
alert(jQuery(this).find('#Image_center').length);
//To check whether element is found or not.