Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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]));
    }

}
like image 935
Chris Avatar asked Feb 10 '11 17:02

Chris


1 Answers

just try to add this line on top of page if you using html page.

<! DOCTYPE html >
like image 50
jatin Avatar answered Oct 14 '22 18:10

jatin