73
rated 0 times
[
78]
[
5]
/ answers: 1 / hits: 24453
/ 13 Years ago, sat, august 13, 2011, 12:00:00
Ok, correct me if I'm wrong, but I take it that jQuery attr()
does NOT work in IE. (marked wontfix) That being the case, what is the best alternative? For example, this works everywhere but IE:
jQuery(document).ready(function($) {
$('.airsrc').each(function() {
var $this = $(this);
var src = $this.attr('data-websrc');
$this.attr('src', src);
});
});
Update: Whoops...I realize the issue. I actually had this inside an if
statement based on a CSS3 media query. Media queries that aren't natively supported in IE8 or lower. The attr()
definitely works!
More From » jquery