Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > workalike for top.location.watch("href",fn) in IE?

Reply
Thread Tools

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

 
 
Gordon Mohr
Guest
Posts: n/a
 
      12-03-2004
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
 
Reply With Quote
 
 
 
 
Michael Winter
Guest
Posts: n/a
 
      12-04-2004
On Sat, 04 Dec 2004 01:44:08 GMT, Rob B <> wrote:

[snip]

> http://msdn.microsoft.com/library/de...p/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.
 
Reply With Quote
 
 
 
 
RobB
Guest
Posts: n/a
 
      12-06-2004
"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/de...p/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!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
unittest.main-workalike that runs doctests too? John J. Lee Python 0 05-05-2006 10:35 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57