from = document.NomeIframe;
if (typeof(from.href)=="undefined") alert("non hai accesso ad oggetti di altri domini");

ciao