开发者

IE7 with PrototypeJS readAttribute and writeAttribute

开发者 https://www.devze.com 2023-03-28 20:46 出处:网络
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:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消