Monday, April 16, 2012

IE9 Error 80020102, using vbscript Preserve keyword with doctype strict

I'm using IE9 beta with the test code below and i encounter an 80020102 error when vbscript tries to append to the array. If I run this in quirks mode it seems to work.



Not knowing if this is an MS issue or something improper I'm doing, I've submitted it to IE9s bug depot. Does anyone have a suggestion on a work around?



I'd post the full html, but it always looks malformed in the preview.



-- VBscript part ---    
Function getBlankArray()
getBlankArray = Array()
End Function

Function appendArray(arr, val)
redim preserve arr(ubound(arr) + 1)
arr(ubound(arr)) = val
appendArray = arr
End Function

-- javascript part ---
function test()
{
var contextKeysArray = getBlankArray();
var jscontextKeysArray = new Array();
for(var x=0; x < 10; x++)
{

jscontextKeysArray[x] = x;

}

for(i = 0; i < jscontextKeysArray.length; i++)
{
contextKeysArray = (appendArray(contextKeysArray, jscontextKeysArray[i]));
}

}




No comments:

Post a Comment