I want to detect when my IFrame changes the location, but not using onload event, actually i need to trigger a function just after the location of the IFrame changes to validate just a list of urls and if the new location is in my list do something on the parent view. this is my actual function that i need to trigger but just before the iframe new url start to loads thats why the event onload doesn't match with what i need
function onLoadFrame() {
var a = document.getElementById("cont").contentWindow.location.href;
if ((a.indexOf("MainDashboard") > -1) || (a.indexOf("AccountManagement") > -1) || (a.indexOf("workspace_home") > -1)) {
$('#nav-bar').fadeOut(0);
$('#u-left-panel').fadeOut(0);
$("#content").css({ marginLeft: "0px" });
} else {
$('#nav-bar').fadeIn(0);
$('#u-left-panel').fadeIn(0);
$("#content").css({ marginLeft: "40px" });
}
}
Update actually i needed to validate the new url or location that was being loaded in the frame in order to trigger a function that show or hide the navigation bar deppending on the new url so it wouldn't seem like delayed