Skip to content

Instantly share code, notes, and snippets.

@lewiscowper
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lewiscowper/c68b9830d2ad9c8c5c0c to your computer and use it in GitHub Desktop.
Save lewiscowper/c68b9830d2ad9c8c5c0c to your computer and use it in GitHub Desktop.
I know this is wrong, but is it closer?
var DisruptionBox = React.createClass({
loadDisruptionsFromServer: function() {
$.ajax({
url: this.props.url,
dataType: 'xml',
method: 'GET',
success: function(xmlResponse) {
console.log(xmlResponse);
var data = $('item', xmlResponse).map(function () {
{
'StationStatus': [
{
'id': ID,
'station': {
'id': ID,
'name': name
},
'Status': {
'id': ID,
'cssClass': cssClass,
'description': description,
'isActive': isActive,
'statusType': {
'id': ID,
'description': description
}
}
}]
}
});
this.setState({data: data});
}.bind(this),
error: function(xhr, status, err) {
console.error(this.props.url, status, err.toString());
}.bind(this)
});
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment