Question

I am trying to display event bright json on my page but isn't working please point me in thee right direction. here is my code below

$(document).ready(function () { var EVENT_JSON = "http://www.eventbrite.com/json/user_list_events?app_key=MyAPPKEY&user_key=MYuserKEy&event_statuses=live,started";

        function AppViewModel() {
            var self = this;
            self.MaxEvents = ko.observableArray(null);


            $.getJSON(EVENT_JSON , function (data) {

                for (i = 0; i < data.events.length; i++) {

                    var rawDate = new Date(data.events[i].event.start_date.substring(0, 10));

                    data.events[i].event.start_date = rawDate.format("m/dd/yy");
                }

                self.MaxEvents(ko.mapping.fromJS(data));
                //  $(".description-text").find('span[style]').css("color", "blue");


            });

        }



        // Activates knockout.js
        ko.applyBindings(new AppViewModel());
    });
Était-ce utile?

La solution

It looks like you are already using jQuery. I'd try adding this library: https://github.com/ryanjarvinen/Eventbrite.jquery.js

Here is a small demo: http://jsfiddle.net/ryanj/mDc7p/

Something like this should log each event:

Eventbrite({'app_key': "YOUR_API_KEY"}, function(eb){   
  var options = {
    'id'    : "561037966"
  };
  eb.organizer_list_events( options, function( response ){
    eb.utils.eventList( response, function(event){
      console.log(event);
    });
  });
});

See the organizer_list_events docs to find out what options are accepted.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top