onload event... question

P

pipjockey

Hi,
I have a file with table with anchors buried in each row. In the body
tag I have

<body onload=highlight()>

I jump to this file with links from another window like:

<a href=file.htm#row200 target='src'> Row200 </a>
<a href=file.htm#row500 target='src'> Row500 </a>

If I hit the jump 'ROW200', my browser will open a (src) window and
scroll to the line with the anchor 'row200' and my javascript routine
'highlight()' will parse the location.hash value and highlight the row
as expected.

If I now hit another link such as 'ROW500', to the same file but with a
different hash value, (the window is already open and loaded), the
window will scroll to the proper anchor location, but there is no
'onload' event fired, and therefore the line is not highlighted.

My question, is there an event that I can capture that indicates the
location.hash value has been changed so I can highlight the new row?

I have tried capturing the onscroll event, but that is not fired
either.
I have been developing with Mozilla, but need to support IE as well..

Any ideas??
Thanks
pip
 
P

pipjockey

Paul said:
One solution is to put the parameter in the query string of the URL, as
well as the hash:

<a href='file.htm?row=200#row200' target='src'>

The browser will treat any change to the query as a whole new URL and
fire the onload event.

Thanks Paul, unfortunately, these are rather large tables and that
causes the whole file to be loaded again. I got around it by
maintaining a link to the child window and calling the child hightlight
function directly from the parent window. I was hoping to use a
'standard' linkage rather than creating my own, but....

pip
 

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

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,120
Latest member
ShelaWalli
Top