I have a Flash menu (Flash MX) and it has links that will open in a <div> in my html document, through a javascript function.
Flash code relating to the javascript:
getURL("javascript:loadLeft('esquerda', '" + subleft[__reg3][__reg2] + "','400','179')" );
getURL("javascript:loadPage('conteudo', '" + subLink[__reg3][__reg2] + "','400','721')" );
Javascript in the HTML document:
Expand|Select|Wrap|Line Numbers
- <script language="JavaScript">
- function loadLeft(id,url,varheight,varwidth) {
- // create iframe inside content div
- document.getElementById(id).innerHTML = "<iframe name='IFrameLeft' frameborder='no' scrolling='no' width='" + varwidth +"' height='" + varheight + "'></iframe>";
- // set the iFrame's height
- document.all.IFrameLeft.height = varheight;
- // insert content of HTML file into created iframe
- document.all.IFrameLeft.src = url;
- }
- </script>
- <script language="JavaScript">
- function loadPage(id,url,varheight,varwidth) {
- // create iframe inside content div
- document.getElementById(id).innerHTML = "<iframe name='IFrameContent' frameborder='no' scrolling='no' width='" + varwidth +"' height='" + varheight + "'></iframe>";
- // set the iFrame's height
- document.all.IFrameContent.height = varheight;
- // insert content of HTML file into created iframe
- document.all.IFrameContent.src = url;
- }
- </script>
There's two <div>, one named "esquerda" and the other named "conteudo", and each link in flash orders the to open a different ifram on each. This is to avoid a framed site, that in this case doesn't make the trick. This works beautifully in Firefox, but not in IE, where it only opens one of the iframes.
The question is: wha'ts wrong with the code that makes IE not to handle it well?
Thanks in advance!