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

前端 未结 7 1639
广开言路
广开言路 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 08:03

    the problem is not in the attr('src') but in something else. The following snippet works in IE8:

        <img id="xxx" src="yrdd">
    
        <script type="text/javascript">
    
            alert($('#xxx').attr('src'));
    
        </script>
    

    But if you for example change the the text/javascript to application/javascript - this code will work in FF but will not work in IE8

    0 讨论(0)
提交回复
热议问题