Skip to content

Instantly share code, notes, and snippets.

@NobbZ
Last active December 17, 2015 08:09
Show Gist options
  • Save NobbZ/5578186 to your computer and use it in GitHub Desktop.
Save NobbZ/5578186 to your computer and use it in GitHub Desktop.
$.ajax({
type: "GET",
url: $(this).attr('href') + "." + $(this).data("format"),
dataType: "html",
beforeSend: function() {
$("#dialog").dialog("open");
$("#dialog").dialog("option", "title", "Loading…");
$("#dialog").html("<div id=\"loadingbar\"></div>");
$("#dialog").dialog("option", "width", "200px");
return $("#loadingbar").progressbar({
value: false
});
},
success: function(xml) {
$("#dialog").dialog("option", "title", $(xml).find("title").text);
$("#dialog").html($(xml).find("content"));
return $("#dialog").dialog("option", "width", "auto");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment