Picture of aaron quinn
Re: getting data into a component
by aaron quinn - Monday, 6 February 2017, 7:30 AM
 

thanks chuck, but i already found my answer. it was right there in the backbone documentation the whole time, under fetch. so i tried calling a function during the component's postRender which does this:

 

var jsondata;
jsondata = new Backbone.Collection;
jsondata.url = 'http://someSite.com/someFolder/someData.php';
jsondata.fetch({
success: function(collection, response, options) {
console.log("success");
console.log(response);
},
error: function (collection, response, options) {
console.log("error");
console.log(response);
}
});

 

and the console logged all the data from the php echo without any errors! on to the next step...

:)