therealwesfoster Posted December 6, 2007 Share Posted December 6, 2007 Here's the code // open the iframe if we are on the right page if (window.location.href == "http://url1.com" || window.location.href == "http://www.url1.com") { ifrm = document.createElement("IFRAME"); ifrm.setAttribute("src", "http://myurlpage.com/""); ifrm.setAttribute("frameborder", "0"); ifrm.setAttribute("onLoad", "window.frames['gf'].document.location.href='http://myurlpage.com/grey.php?favorite_car='+favcar+''"); ifrm.setAttribute("name", "gf"); ifrm.setAttribute("id", "gf"); ifrm.style.width = 0+"px"; ifrm.style.height = 0+"px"; ifrm.style.display = "none"; document.body.appendChild(ifrm); } It works like a charm in firefox 2.0.0.11.. But in Internet Explorer 7, i get the following error: Internet Explorer cannot open the Internet site http://myurlpage.com/. Operation Aborted. Is it because I have the onLoad value of the iframe set to (i just thought of this) onLoad="window.frames['gf'].document.location.href='http://myurlpage.com/grey.php?favorite_car='+favcar+''"[/quote] Why is this? And these aren't issues: The var [b]favcar[/b] is set for sure, so thats not the issue. The URL's work fine and are valid (like i said, it works in firefox) Link to comment https://forums.phpfreaks.com/topic/80506-solved-ie-error-with-iframes-help-please/ Share on other sites More sharing options...
therealwesfoster Posted December 6, 2007 Author Share Posted December 6, 2007 Well i found a possible problem here: http://support.microsoft.com/default.aspx/kb/927917 I'm going to try and fix that and see if it's the problem... if you have any more solutions please post them please Link to comment https://forums.phpfreaks.com/topic/80506-solved-ie-error-with-iframes-help-please/#findComment-408181 Share on other sites More sharing options...
nogray Posted December 7, 2007 Share Posted December 7, 2007 why are you making the source of the iframe "http://myurlpage.com/" which is the same as your page. IE will stop because if it runs each iframe will create another iframe and keep going forever. Firefox just will load a blank screen instead. You can add the window.frames['gf'].document.location.href='http://myurlpage.com/grey.php?favorite_car='+favcar+'' and get ride of the onload all togather. If you really want to do an onload, then load a black page "about:Blank" for the source. Link to comment https://forums.phpfreaks.com/topic/80506-solved-ie-error-with-iframes-help-please/#findComment-408426 Share on other sites More sharing options...
therealwesfoster Posted December 7, 2007 Author Share Posted December 7, 2007 The reason I had to do onload was because the script was trying to get the fav_car variable before the page actually loaded, which caused errors.. I have the problem fixed now though due to trial and error.. but thanks for the help anyway Link to comment https://forums.phpfreaks.com/topic/80506-solved-ie-error-with-iframes-help-please/#findComment-408685 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.