workalike for top.location.watch("href",fn) in IE?

Discussion in 'Javascript' started by Gordon Mohr, Dec 3, 2004.

  1. Gordon Mohr

    Gordon Mohr Guest

    I'd like to set up a bit of javascript to be run when other javascript
    loads a new page via something like { top.window.location.href =
    newLocation }, and have access to the new value. (For example, so that
    the target URL can be modified before fetching.)

    In Mozilla, top.location.watch("href",fn) works well for this purpose.

    In IE, neither watch() nor an onpropertychange handler set on
    top.window.location work.

    Any tricks to making this work? Any alternate approaches I should
    consider.

    Any help appreciated. Thanks,

    - Gordon @ IA
    Gordon Mohr, Dec 3, 2004
    #1
    1. Advertising

  2. [OT] Re: workalike for top.location.watch("href",fn) in IE?

    On Sat, 04 Dec 2004 01:44:08 GMT, Rob B <> wrote:

    [snip]

    > http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml
    > /reference/events/onbeforeunload.asp


    It's best to surround long URLs with <URL:...>. This tends to stop line
    feeds from breaking them. Also, those particular MSDN URLs containing
    /library/default.asp?url= rely on use of the tree on the left-hand side
    which isn't compatible with all browsers. Removing that part, producing

    <URL:http://msdn.microsoft.com/workshop/author/dhtml/reference/events/onbeforeunload.asp>

    will take you to the right page regardless of what browser is used.

    Mike

    --
    Michael Winter
    Replace ".invalid" with ".uk" to reply by e-mail.
    Michael Winter, Dec 4, 2004
    #2
    1. Advertising

  3. Gordon Mohr

    RobB Guest

    Re: [OT] Re: workalike for top.location.watch("href",fn) in IE?

    "Michael Winter" <> wrote in message news:<opsihgyumfx13kvk@atlantis>...
    > On Sat, 04 Dec 2004 01:44:08 GMT, Rob B <> wrote:
    >
    > [snip]
    >
    > > http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml
    > > /reference/events/onbeforeunload.asp

    >
    > It's best to surround long URLs with <URL:...>. This tends to stop line
    > feeds from breaking them. Also, those particular MSDN URLs containing
    > /library/default.asp?url= rely on use of the tree on the left-hand side
    > which isn't compatible with all browsers. Removing that part, producing
    >
    > <URL:http://msdn.microsoft.com/workshop/author/dhtml/reference/events/onbeforeunload.asp>
    >
    > will take you to the right page regardless of what browser is used.
    >
    > Mike


    Thanks Mike!
    RobB, Dec 6, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John J. Lee
    Replies:
    0
    Views:
    255
    John J. Lee
    May 5, 2006
  2. Scott

    window.top.location.href

    Scott, Dec 22, 2003, in forum: ASP General
    Replies:
    7
    Views:
    326
    Roland Hall
    Dec 31, 2003
  3. saiho.yuen
    Replies:
    3
    Views:
    411
    kaeli
    Sep 14, 2004
  4. Replies:
    2
    Views:
    445
  5. Jeff

    top.location.href question

    Jeff, Dec 24, 2006, in forum: Javascript
    Replies:
    2
    Views:
    143
Loading...

Share This Page