Skip to content

Instantly share code, notes, and snippets.

@mrtuvn
Last active December 12, 2016 10:12
Show Gist options
  • Save mrtuvn/8caf052977df6912cf949910930a2dd7 to your computer and use it in GitHub Desktop.
Save mrtuvn/8caf052977df6912cf949910930a2dd7 to your computer and use it in GitHub Desktop.
$.ajax({
method: "GET",
data: {},
dataType: 'json',
url: previewUrl, // http://m2.dev/megamenu/menu/view/id/1
cache: false,
showLoader: true,
context: $('body'),
success: function(res) {
$("#preview-area").removeClass('loading').addClass('loaded');
if (menuPreview.options.menuType == 'vertical') { //vertical
$('.horizontal-area').hide();
$('.vertical-area').show();
$('.vertical-preview').html(res);
} else { // horiziontal
console.log('test');
$('.horizontal-area').show();
$('.vertical-area').hide();
$('.horizontal-preview').html(res);
}
//$$("#preview-area").html(res);
$("#preview-area").first().trigger('contentUpdated');
$("#preview-area").fadeIn(500);
},
error: function(XMLHttpRequest, textStatus, errorThrown){
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment