473,326 Members | 2,076 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,326 software developers and data experts.

onload event... question

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

Jul 23 '05 #1
2 1596
pipjockey wrote:
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.


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.
Jul 23 '05 #2
Paul R wrote:
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

Jul 23 '05 #3

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

Similar topics

4
by: Pai | last post by:
hello there, I am trying to rersize the window it works find in IE but doea not work with mozilla window.attachEvent(onload,MWSOnLoad); window.onload = function (MWSOnLoad) { alert('hello');...
6
by: Brian | last post by:
Hi everyone, I'm writing a function (in javascript) that needs to do one thing if the page has not loaded, and another (different) thing if the page has already loaded. I'm looking for a way...
2
by: laredotornado | last post by:
Hello, I am looking for a cross-browser way (Firefox 1+, IE 5.5+) to have my Javascript function execute from the BODY's "onload" method, but if there is already an onload method defined, I would...
3
by: Frances | last post by:
I have three functions I need triggered when page loads, so have <body onload="function1();function2();function3()"> but I want to take all these function calls out of body tag and call them...
3
by: John | last post by:
Hi, This is my first experiment with C#, I'm trying to handle the resize event. According to the documentation I should handle the Layout event for this. My question is: how do I register this...
3
by: Christian | last post by:
hi, what is the difference between the Page_Load() and OnLoad() event handlers. do they originate from a different point ?
3
by: Cc | last post by:
does event onload mean form already loaded or before loaded? I make a form and I inherit that form on another form, when I run, it execute the process on the parent form without showing the form on...
5
by: Andy Fish | last post by:
Hi, I have an asp.net web application which uses a pop-up form that works a bit like a dialog box. when the user clicks "OK" it does a postback (basically a form post if you don't know .net) to...
7
by: Q | last post by:
Question: why doesn't: window.onLoad = recalculate(); work, and do I have to use: window.onLoad = recalculate; (IE) ???
6
by: adamscybot | last post by:
Here is the site in question: http://www.sws.vxcomputers.com/h2k/ Basically, on the left, you'll see a roster (them images) and you have to click the "Counter-Strike" link for it to load the...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.