Mensagem "Carregando" com iFrame

0 respostas
gmmascarin

Bom dia

Estou exibindo um relatório dentro de um iframe criado dinâmicamente. Gostaria que após o carregamento do meu iframe exibisse uma mensagem avisando que o relatório foi carregado. Utilizei o evento onload do javascript, mas não funcionou. Talvez eu tenha feito errado. Segue o código. Por favor, me ajudem.

function construirIframe(source){
	var iframe = document.createElement("iframe");
	 iframe.setAttribute("id","frameRelatorio");
	 iframe.setAttribute("name","frameRelatorio");
	 iframe.setAttribute("width","100");
	 iframe.setAttribute("height","100");
	 iframe.setAttribute("border","1");
	 iframe.onload="new function(){document.getElementById('info').innerHTML='Carregado'}";	 //AQUI PARECE NÃO FUNCIONAR.  tentei emitir alert('carregado') e também não funcionou
	 iframe.setAttribute("src", source);
	 document.forms[0].appendChild(iframe);
	 window.frames['frameRelatorio'].name="frameRelatorio";

}

Obrigado

Criado 1 de setembro de 2011
Respostas 0
Participantes 1