IE7 with PrototypeJS readAttribute and writeAttribute
I am getting errors like "Object doesn't support property or method 'writeAttribute'" in IE7 with a script. It works fine in all other browsers I have tried. The code is as follows:
var imgData = [
['../images/1.png','1'],
['../images/2.png','2'],
['../images/3.png','3']
];
imgArray = new Array();
for(i=0; i < imgData.length; i++){
imgArray[i] = new Image();
imgArray[i].writeAttribute('src',imgData[i][0])开发者_JS百科;
}
Can anyone point me in the right direction to get this working in IE7.
Thanks.
I had to change writeAttribute to setAttribute and readAttribute to getAttribute.
精彩评论