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) Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.