473,387 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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
Jul 23 '05 #1
3 3253
Gordon Mohr wrote:
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.
A> ny help appreciated. Thanks,
- Gordon @ IA


Maybe...

http://msdn.microsoft.com/library/de...p/author/dhtml
/reference/events/onbeforeunload.asp

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #2
On Sat, 04 Dec 2004 01:44:08 GMT, Rob B <fe******@hotmail.com> 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.
Jul 23 '05 #3
"Michael Winter" <M.******@blueyonder.co.invalid> wrote in message news:<opsihgyumfx13kvk@atlantis>...
On Sat, 04 Dec 2004 01:44:08 GMT, Rob B <fe******@hotmail.com> 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!
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Erik T. Nomad | last post by:
I've created a link that will enable the reader of any page on my website to click it, enter an e-mail address, and have it arrive in that inbox with a hyperlink to the site. However, I'm...
27
by: Abdullah Kauchali | last post by:
Hi folks, Can one rely on the order of keys inserted into an associative Javascript array? For example: var o = new Object(); o = "Adam"; o = "Eve";
8
by: Phil Powell | last post by:
if (document.location.href.indexOf('?') >= 0) document.location.href = document.location.href.substring(0, document.location.href.indexOf('?')); if (document.location.href.indexOf('#') >= 0) {...
2
by: John | last post by:
I have some code that changes a PDF file in another frame using: parent.frame.document.location.href = "PDF File" This code works fine the first time it is called. But if a PDF file is in that...
10
by: Dieter Salath? | last post by:
Hi, in our webpage, a user could open a windows explorer to his temp directory with a simple link and usage of the file protocol: <a href="file://C:\temp" target="_blank">C:\temp</a> This...
4
by: Roger | last post by:
Hi, I have been using this trick for some time on a home page. The idea is to verify the user's browser has Javascript enabled before allowing the user to access a logon page. The...
12
by: Dave Hammond | last post by:
I recently noticed the stylesheet link in an html page had the href set to a PHP script, as in: <LINK REL="stylesheet" href="some_css.php" type="text/css"> Presumably the file being referenced...
1
by: =?Utf-8?B?Sm9obg==?= | last post by:
I have a dropdownlist in masterpage and a big table in contentpage. When ddl selection changes, I want to move a specific row of the table to the top of the contentpage. Can I do something like <a...
1
by: power9888 | last post by:
Can anyone help to resolve this issue please? I have a bookmark in the page #top. I need to use javascript to move to the move mark top. However, the javascript location.href = "#top"; does not...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.