Javascript - cannot make static reference to non-static function ....
Posted
by Ankur
on Stack Overflow
See other posts from Stack Overflow
or by Ankur
Published on 2010-05-06T09:38:35Z
Indexed on
2010/05/06
9:48 UTC
Read the original article
Hit count: 221
I am making a reference to the Javascript function splice() on an array and I get the error:
"Cannot make a static reference to the non-static function splice()"
What's going on - how is this a static reference, aren't I referencing an instance of an Array class and its method - how is that static?
$(document).ready( function() {
var queryPreds = new Array();
var queryObjs = new Array();
function remFromQuery(predicate) {
for(var i=0; i<arrayName.length;i++ ) {
if(queryPreds[i]==predicate)
queryPreds.splice(i,1);
queryObjs.splice(i,1);
}
}
}
© Stack Overflow or respective owner