PDA

View Full Version : Missing } in XML expression - not what you might think



jump23
17 Feb 2011, 8:10 PM
This one is a real stumper, or I'm missing something big.

I'm uploading a file in a form, and using the upload response to populate a grid:



fp.form.submit({url: '/data/import/import_spreadsheet_data_do',
failure: function(form, action) {
var msg = '';
var errors = action.result.errors;
var i = 0;
for (var i in errors) {
msg += errors[i] + '<br>';
}

shared.alert(msg);
},
success: function(form, action){
alert('test');
return;
});


This works fine with the following response from the server:


{"success":true,"type":"xls","cols":12,"code":"OSlH7WQTcZyAD8c2LX69twXEb0v0bDYL","result":[{"col5":"ADDRESS","col3":"POSITION","col11":"HOME PHONE","col12":"","col2":"Spouse Name","col9":"ZIP","col6":"ADDRESS 2","col7":"CITY","col1":"FIRST NAME","col0":"LAST NAME","col8":"STATE","col10":"WORK PHONE","col4":"COMPANY"},{"col5":"1234 Lane on the Lake","col3":"","col11":"","col12":"","col2":"","col9":"43219","col6":"","col7":"Columbus","col1":"Jennifer","col0":"Adair","col8":"OH","col10":"123-286-6577","col4":""},{"col5":"2978 E. 12th Ave.","col3":"","col11":"","col12":"","col2":"","col9":"43219","col6":"","col7":"Columbus","col1":"William","col0":"Adams","col8":"OH","col10":"614-252-404","col4":""}]}


But this response gives the dreaded "Missing } in XML expression" error:



{"success":true,"type":"xls","cols":12,"code":"K3UdbX1MPTsCc5n6hxrdFlTC23aGEXlq","result":[{"col5":"ADDRESS","col3":"POSITION","col11":"HOME PHONE","col12":"","col2":"Spouse Name","col9":"ZIP","col6":"ADDRESS 2","col7":"CITY","col1":"FIRST NAME","col0":"LAST NAME","col8":"STATE","col10":"WORK PHONE","col4":"COMPANY"},{"col5":"1234 Lane on the Lake","col3":"","col11":"","col12":"","col2":"","col9":"43219","col6":"","col7":"Columbus","col1":"Jennifer","col0":"Adair","col8":"OH","col10":"123-286-6577","col4":""},{"col5":"2978 E. 12th Ave.","col3":"","col11":"","col12":"","col2":"","col9":"43219","col6":"","col7":"Columbus","col1":"William","col0":"Adams","col8":"OH","col10":"614-252-4045","col4":""}]}


The ONLY difference in the responses is a single character - col10 in the last record. Content-Type is "text/html" every time.

This occurs in FF, not in Chrome. Any thoughts?