[jQuery] problem with $.JSON request

2008-12-05 Thread suhinin.dmit...@gmail.com

I spek in Englisn bed. Sorry. Part of sample code:

$.getJSON("http://some.url/?callback=?";
function(json){
var result   = json.error;
var message  = json.message;
var record   = json.data;
});

How I return value of the variable: result or message or record to
others part of script? it is possible?


[jQuery] Re: problem with $.JSON request

2008-12-08 Thread suhinin.dmit...@gmail.com

For example:

function someName() {
 var result = this.getAllRecords();
var data   = new Array();
var test   = 13;

alert(test);
while(result.isValidRow()) {

$.getJSON("http://test.url/?callback=?";,
{
  TABLE_NAME:'BARCODE_CODES',
  RECORD_ID:  result.field(0), BARCODE_CODE: result.field(1),
  ITEM_COUNT: result.field(2), DATE_ADD: result.field
(3)
},
function(json){
var result   = json.error;
var message  = json.message;
var record   = json.data;
 test = 14;

if(!result) {
showWarning('RECORD_ID: ' + record + ' ' + message);
} else {
showError(message);
}

});

   result.next();
}
alert(test);
}
alert always show 13