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

G

Gordon Mohr

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
 
M

Michael Winter

[snip]

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
 
R

RobB

Michael Winter said:
[snip]

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!
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top