views:

38

answers:

0

I am using Highcharts (http://highcharts.com) and attempting to display a colorbox (http://colorpowered.com/colorbox/) when I click a bar chart column. Highcharts allows attaching a method that gets called on click (Highcharts docs).

This works great for something as simple as calling an alert, or providing static HTML to the colorbox, but as soon as I try to provide use content loaded from a script (AJAX), it only fires ONCE. I am guessing this is because the its all loaded on DomReady.. but regardless of whether I'm right or now, anyone have any suggestions as to how I can get this working?

This is the error:

Error: $("<div/>").colorbox is not a function
Source File: XXX
Line: 390

My code:

function() {
    $('<a/>').attr('href', '/link_to/ajax.call').colorbox({open: true});
}