Some ads on my website are slowing down load time. How can I use jquery to load the ad code while the page is loading?
I tried something like this:
$(document).ready(function () {
advertisement();
function advertisement() {
$.ajax({
type: "GET",
url: "/advertisement.php",
data: "type=googleads",
beforeSend: function () {
$("#advertisement").html('Loading ...');
},
cache: false,
success: function (a) {
$("#advertisement").html(a);
}
});
}
});
But it redirects me to the ads company site instead of showing the ads.
Is it possible?