Jquery attr('src') undefined in IE 8 (works in FF)

前端 未结 7 1642
广开言路
广开言路 2021-01-18 07:22

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

7条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-18 07:54

    And why don't you easily use one working?

    alert(jQuery(this).children('#Image_center').attr('src'));
    

    change children to find

    alert(jQuery(this).find('#Image_center').attr('src'));
    

    It is probably the easiest solution, and when it work, why wouldn't you use it?

提交回复
热议问题