The site I\'m working on has a Live Chat plugin on an iframe. I\'m trying to change an image if there are no agents available. My code works on the console, but nothing on t
Found this from Elijah Manor's website which works very well
function iFrameLoaded(id, src) {
var deferred = $.Deferred(),
iframe = $("").attr({
"id": id,
"src": src
});
iframe.load(deferred.resolve);
iframe.appendTo("body");
deferred.done(function() {
console.log("iframe loaded: " + id);
});
return deferred.promise();
}
$.when(iFrameLoaded("jQuery", "http://jquery.com"), iFrameLoaded("appendTo", "http://appendto.com")).then(function() {
console.log("Both iframes loaded");
});