Iframe problem with IE and location

I’ve been using the following code without problems for the past 5 years or so to check that an iframe has been launched from its parent:

if (top.location == location)

Suddenly, just in the past couple of days it’s stopped working in some versions of IE which I’m guessing might be due to a javascript update that some users of the site have had while others haven’t. No problems with Firefox, Chrome, Safari etc.

Can anyone suggest why

  if (top.location == location)

should no longer function as expected all of a sudden? I’ve also tried window.top.location and window.location and window.parent.location but it made no difference. I don’t run a Microsoft OS myself so at present not sure which of the 2 variables (top.location and location) isn’t being determined correctly.

Issue now resolved, please ignore.