Вот альтернатива, которая является более общей в том смысле, что она не называет родительский URL и не использует отдельный вызов функции:
// is the current page at the top of the browser window hierarchy?
if (top.location != self.location)
{
// it isn't, so force this page to be at
// the top of the hierarchy, in its own window
top.location = self.location
}