cannot reference window.location.href

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ShinCat

    cannot reference window.location.href

    Hello,

    I'm a JavaScript newbie with a serious headache. The following routine generates the following error

    Error: uncaught exception: Permission denied to get property Location.href

    var spawnWindow;
    function openSpawnWindow ( url )
    {
    if( !spawnWindow || spawnWindow.clo sed )
    {
    spawnWindow = window.open(url ,'spawnWin');
    }
    else
    {
    if( spawnWindow.loc ation.href != url )
    {
    spawnWindow.loc ation.href = url;
    }
    }
    }

    Invoked in body

    <a href="javascrip t:openSpawnWind ow('http://www.cycleforaut ism.com')">Cycl e for Autism</a>

    Windows XP, SP1
    Mozilla 1.5, Firebird 0.7, MS IE 6.1

    Please show me the errors of my ways.

    Yours truly,
    Ted
  • Lee

    #2
    Re: cannot reference window.location .href

    ShinCat said:[color=blue]
    >
    >This is a multi-part message in MIME format.[/color]

    Please post only plain text to this newsgroup.

    [color=blue]
    >I'm a JavaScript newbie with a serious headache. The following routine =
    >generates the following error
    >
    >Error: uncaught exception: Permission denied to get property =
    >Location.hre f[/color]

    It would be a security violation to allow one web page to
    read any property of another web page that's opened from a
    different domain.

    Comment

    • ShinCat

      #3
      Re: cannot reference window.location .href

      Thanks for the answer. Is this being caused due to authoring on a local
      host? I'm running XP Pro with built in IIS running . I wrote the JavaScript
      so no more than one window would be spawned from a Web page full of other
      links. What does the browser see in terms of two domains?

      All your assistance much appreciated,
      Ted.

      "Lee" <REM0VElbspamtr ap@cox.net> wrote in message
      news:bpubgt01vb s@drn.newsguy.c om...[color=blue]
      > ShinCat said:[color=green]
      > >
      > >This is a multi-part message in MIME format.[/color]
      >
      > Please post only plain text to this newsgroup.
      >
      >[color=green]
      > >I'm a JavaScript newbie with a serious headache. The following routine =
      > >generates the following error
      > >
      > >Error: uncaught exception: Permission denied to get property =
      > >Location.hre f[/color]
      >
      > It would be a security violation to allow one web page to
      > read any property of another web page that's opened from a
      > different domain.
      >[/color]


      Comment

      Working...