Skip to content Skip to sidebar Skip to footer

Jquery Attr In Ie7

I have the following HTML: Copy

Should be

<imgsrc="anImage.jpg" />

Different browsers may handle this in different ways

For me, in Chorme, it certainly doesn't work in this JSFiddle: http://jsfiddle.net/apKdC/, however when I fix the quotes in this updated fiddle: http://jsfiddle.net/apKdC/1/ it all works fine.

Solution 2:

The real problem is that before version 9, Internet Explorer does not recognise unknown elements, such as the HTML5 elements you're using.

You can fix it by including this in your <head>:

<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

For some background information, read: http://paulirish.com/2011/the-history-of-the-html5-shiv/

Here's a page that does just that, and works in IE6/7: http://jsbin.com/izina3

Solution 3:

you don't have correct html syntax see src attribute in first image missing " http://jsfiddle.net/HwmEK/1/ see here its working

Solution 4:

I could be totally off-track here but shouldn't you have:

alert($('img', $(this)).attr('src'));

So $(this) not this

Post a Comment for "Jquery Attr In Ie7"