Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Olá pessoal, tenho uma pagina com um iframe, sendo teste1.html a pai e teste2.html a filha. Segue os códigos...
teste1.html
<html>
<head>
<script language="javascript" type="text/javascript">
function redimensiona(tamanho) {
obj = document.getElementById('master_frame');
obj.width = tamanho;
obj.height = tamanho;
}
</script>
</head>
<body>
<iframe id="master_frame" width="200px" height="200px" src="file:///D:/projeto_teste/teste2.html">
</iframe>
</body>
</html>
e a teste2.html...
<html>
<head>
</head>
<body>
<input value="Dimensiona" style="position: absolute; top: 100px; width: 100px;" type="button" onclick="top.redimensiona(400);">
</input>
</body>
</html>
O código funciona no IE e FF mas no chrome não, quando clico no botão que está dentro do frame dá o erro...
teste2.html:8Uncaught TypeError: Property 'redimensiona' of object [object DOMWindow] is not a function
Espero ajuda! Obrigado!
Carregando comentários...