Currently I'm using jQuery to load a view, like this:
$.ajax({
type: 'POST',
url: Drupal.settings.basePath + 'views/ajax',
dataType: 'json',
data: 'view_name=' + viewName + '&view_display_id=default&view_args=' + viewArgument, // Pass a key/value pair.
success: function(data) {
var viewHtml = data[1].data;
target.children().fadeOut(300, function() {
target.html(viewHtml);
var newHeightOfTarget = target.children().height();
target.children().hide();
target.animate({
height: newHeightOfTarget
}, 150);
target.children().delay(150).fadeIn(300);
Drupal.attachBehaviors(target);
});
},
error: function(data) {
target.html('An error occured!');
}
});
My problem is, that for example if the view uses the 'Field Slideshow' module, the js/css files needed for it to work properly are not loaded. What could be a nice (= kittens unharmed) solution to this?