All site is loaded when I click to load only Iframe.
Hi.
In my fallow code, when I try to load the iframe all site is load.
- </head>
- <body onLoad="loadFrameInit()">
- <script>
- function loadFrameInit(){
- $("#IframeMaster").attr('src','Modelos/Mcs/mcs.html').load(function(){
- alert("1");
- })
- }
- </script>
- <div id="MenuModelos">
- <img src="img/menuBTN.png" id="ImgMenuModelos" title="Selecione outros modelos" onClick="AbreMenuModel()"></img>
- <div id="AreaModels">
- <img src="img/buttonBody.png" class="ponteiro" onClick="AbreMenuModel('Modelos/SuperRacer/superRacer.html')"></img>
- </div>
- </div>
- function AbreMenuModel(model){
- if($("#MenuModelos").css('top') <= "-50px"){
- $("#MenuModelos").animate({"top": "+=50"}, "slow");
- testaSeAbriu = "true";
- }else{
- $("#MenuModelos").animate({"top": "-=50"}, "slow");
- $("#IframeMaster").attr('src',model).load(function(){
- })
- }
It is strange, because When I load an Iframe only this need loaded and not all site. The alert in
loadFrameInit(0 is showed in all time when I click in
AreaModels in one image and send the commando
onClick="AbreMenuModel('Modelos/SuperRacer/superRacer.html').
Am I correct?
Thanks
EDIT: the problem apparently is inside in
loadFrameInit(). I have a setInterval that if is looping, happens this error. If the clearinterval is call, and finish the function, only iframe is loaded.