473,372 Members | 836 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,372 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 3250
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.