Fetching latest URL of a frame...

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

    Fetching latest URL of a frame...

    Hi all,

    I'm trying to get the latest URL that a user visited in the frame.
    But it just doesn't work.

    function setURL() {
    //document.cc.fm. URL.value=docum ent.main.locati on.href;
    alert("onLoad") ;
    alert("Page "+document.fram es[0].location.href+ " is loaded");

    }
    ......

    <FRAMESET rows="*,40%" >
    <FRAME src="about:blan k" name="main" onChange="setUR L();">
    <FRAME src="cc.html" name="cc">

    What's the problem?
  • Martin Honnen

    #2
    Re: Fetching latest URL of a frame...



    hunglm wrote:

    [color=blue]
    > I'm trying to get the latest URL that a user visited in the frame.
    > But it just doesn't work.
    >
    > function setURL() {
    > //document.cc.fm. URL.value=docum ent.main.locati on.href;
    > alert("onLoad") ;
    > alert("Page "+document.fram es[0].location.href+ " is loaded");[/color]
    [color=blue]
    > <FRAME src="about:blan k" name="main" onChange="setUR L();">[/color]

    Who (or which documentation) told you that there is an onchange event
    handler for <frame> elements? That handler attribute doesn't exist.
    Some browsers (IE5.5/6, Netscape 7, Mozilla, latest Opera (7.5x) support
    <frame onload="..." src="whatever.h tml">
    so that handler could help but I am not sure whether Safari, Konqueror
    and older Opera 7.xy support that.

    --

    Martin Honnen

    Comment

    • hunglm

      #3
      Re: Fetching latest URL of a frame...

      Martin Honnen <mahotrash@yaho o.de> wrote in message news:<41555297$ 0$26119$9b4e6d9 3@newsread4.arc or-online.net>...[color=blue]
      > hunglm wrote:
      >
      >[color=green]
      > > I'm trying to get the latest URL that a user visited in the frame.
      > > But it just doesn't work.
      > >
      > > function setURL() {
      > > //document.cc.fm. URL.value=docum ent.main.locati on.href;
      > > alert("onLoad") ;
      > > alert("Page "+document.fram es[0].location.href+ " is loaded");[/color]
      >[color=green]
      > > <FRAME src="about:blan k" name="main" onChange="setUR L();">[/color]
      >
      > Who (or which documentation) told you that there is an onchange event
      > handler for <frame> elements? That handler attribute doesn't exist.
      > Some browsers (IE5.5/6, Netscape 7, Mozilla, latest Opera (7.5x) support
      > <frame onload="..." src="whatever.h tml">
      > so that handler could help but I am not sure whether Safari, Konqueror
      > and older Opera 7.xy support that.[/color]

      Uh...
      Well , thanks, but that's not the point for me. My problem is why

      alert("Page "+document.fram es[0].location.href+ " is loaded");

      doesn't work. "onChange=. .." is orginally "onLoad=... " , I'm sorry for
      that but it just worked for me.


      Thanks.

      Comment

      Working...