-
-
Save uzbekdev1/ecdd181703edba1a5c65c2ceb0799d80 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// LOAD AJAX PAGES | |
function loadURL(url, container) { | |
$.ajax({ | |
type: "GET", | |
url: url, | |
dataType: 'html', | |
cache: true, | |
beforeSend: function(){ | |
container.html('<h1><i class="fa fa-cog fa-spin"></i> Loading...</h1>').fadeIn('fast'); | |
}, | |
success: function (data) { | |
container.html(data).fadeIn('slow'); | |
drawBreadCrumb(); | |
// console.log("ajax request successful") | |
}, | |
error: function (xhr, ajaxOptions, thrownError) { | |
container.html('<h4 style="margin-top:10px; display:block; text-align:left"><i class="fa fa-warning txt-color-orangeDark"></i> Error 404! Page not found.</h4>'); | |
//container.hide().html('<h1><i class="fa fa-cog fa-spin"></i> Loading...</h1>').load("ajax/error404.html").fadeIn('slow'); | |
drawBreadCrumb() | |
}, | |
async: false | |
}); | |
console.log("ajax request sent"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment