First there is a mistake in syntax.
var attr={node:1
;value:"2"}
use
,
I think forEach is available only for Arrays.
{node:1,value:"2"}
is an object. To make it an array, just wrap it with "[]"
[{node:1,value:"2"}]
Check this and let me know... below is a working example tested with Firefox.
var obj = [{name:"John",age:25}];
obj.forEach(function(person){
alert(person.name+" is "+person.age+" years old");
});