Works perfectly in FF (as you'd expect) but for some reason when I do this:
$('#objectname').attr('data', 'newcontent.php')
...absolutely nothing happens in IE.
When I do an
alert($('#objectname').attr('data', 'newcontent.php'))
it shows the new data source but doesn't change it...
Any ideas please?
We had the same problem. Our solution was to re-set the innerHtml of the parent node. With this (ugly) hack IE picks up the changed data attribute and renders accordingly.
I don't think
data
is a valid HTML attribute. Did you mean to use the jQuerydata()
function?Update for 9/2014 — This question and answer is over five years old now, and isn't really relevant any more.
data
is now a valid attribute. I'm leaving my original answer for historical purposes though.