My jData is actually a JSON array but when I try to pass it it gives me an error.
This below works:
$test.pass = {
lines:{ID:'ID', Date:'Date'},
data:{}
};
but when I want to pass a JSON array that I am getting back from an ajax I get an error.
$.ajax({
type: 'POST',
url: 'someurl',
dataType: 'json',
success: function(data){
$test.pass = {
lines:{ID:'ID', Date:'Date'},
data:data
};
}
});
it gives me an error of:
TypeError: Cannot read property ‘data’ undefined
Is $test a ‘global’ variable? If you put a breakpoint on the first line in the success function, what is the value of data?