gehuangyi20 / ie7-js

Automatically exported from code.google.com/p/ie7-js
0 stars 0 forks source link

ie7-js crash if the page is contained inside a iframe on parent document. #119

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have a page that has an iframe which loads an internal page. On that
internal page I am using ie7-js and only when it is used in iframe on IE6 &
IE7, ie7-js (both IE7.js and IE8.js crashes)

If I load the internal page by itself, everything works without a hitch. Is
there a workaround?

Original issue reported on code.google.com by soichih on 15 Oct 2008 at 11:24

GoogleCodeExporter commented 9 years ago
Try swapping the line

if (/ie7_off/.test(top.location.search)) return;

with

try
{
    if (/ie7_off/.test(top.location.search)) return;
}
catch (e)
{
}
finally
{
  if (/ie7_off/.test(window.location.search) || appVersion < 5) return;
}

The problem has to do with JavaScript domain security in IE 6.

Original comment by benjamin...@gmail.com on 13 Jan 2009 at 8:54

GoogleCodeExporter commented 9 years ago
Thanks!! I will try this fix shortly..

Original comment by soichih on 13 Jan 2009 at 9:16

GoogleCodeExporter commented 9 years ago
I fixed the problem in a different way. I found that document.body wasn't 
present 
soon enough so I added 'if (!document.body) throw true' underneath the line 
that 
says 'documentElement.doScroll("left")'. That did the trick.

Original comment by JerseyChewi@gmail.com on 5 Feb 2010 at 4:52

GoogleCodeExporter commented 9 years ago
I added the fix suggested by chewi.

Original comment by dean.edw...@gmail.com on 8 Feb 2010 at 3:46