Hi anyone can help, am having this error on line 10: uncaught TypeError: Cannot read property '0' of null.
I have use the same code other places, same array but never got this error. I dont know why am having this error here.

this.addEventListener("message",function(e){
    importScripts('test.js');
    var object=e.data;
    object=JSON.parse(object);

    mArray=object.array;
    var test=new test();
    for (var y=0;y<8;y++){
        for (var x=0;x<4;x++){
            word="" + mArray[y][x]+ mArray[y][x+1] + mArray[y][x+2] + mArray[y][x+3] + mArray[y][x+4];
            var object={test:word}
            this.postMessage(JSON.stringify(object));
        }
    }

Recommended Answers

All 2 Replies

I'm new at looking at this kind of stuff, but could it be that you're missing }) after line 14?

sorry i forgot to put it here. }); but i have it in my original code. still not working!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.