// AJAX se content load karna
function loadFeaturedPost() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("featured-post-container").innerHTML = this.responseText;
}
};
xhttp.open("GET", "URL_OF_YOUR_FEATURED_POST_CONTENT", true);
xhttp.send();
}
// Preload function
function preloadFeaturedPost() {
if (document.readyState === 'complete') {
loadFeaturedPost();
} else {
window.addEventListener('load', loadFeaturedPost);
}
}
// Call preload function
preloadFeaturedPost();
Comments
Post a Comment