0

In this page: http://www.depositosalto.com.br/lojas.php, I have a javascript to resize a div and a iframe containing a google maps location. Happens that the javascript is executed only after the iframe is loaded. How I do to the javascript be executed first?

EDIT: The javascript is not to resize the iframe, but another div with the content with id = "conteudo".

Renato Dinhani
  • 35,057
  • 55
  • 139
  • 199

2 Answers2

1

Use the <body onload: > option. This triggers when the page is first loaded.

Hidde
  • 11,493
  • 8
  • 43
  • 68
1

You can calculate the proper size of the IFRAME and then generate the IFRAME tag using JavaScript. This will guarantee that your IFRAME will appear only after JS code executed.

P.S. Use tag to make sure that people who has JavaScript turned off will still see the IFRAME with Google Map.

dmitry7
  • 441
  • 3
  • 6