I have a jQuery function that updates my data ever few seconds.
But! It's not parsing the javascript it's loading. It just calls it appropriately every few seconds, and replaces my content with unparsed javascript code.
setupMediaIndexPoller: function(organization) {
url = '/organizations/' + organization + '/media/photos_and_video'
$.PeriodicalUpdater(url, {
method: 'get',
data: '',
minTimeout: 20000,
maxTimeout: 60000,
multiplier: 2,
type: 'html',
maxCalls: 0,
autoStop: 0
}, function(data) {
$('#media_index').html(data);
});
}
I tried making the dataType: script
, but that didn't help. Any ideas?