Last active
November 14, 2019 13:13
-
-
Save tripflex/8203493 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
thx