473,779 Members | 1,873 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

onload event... question

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

<body onload=highligh t()>

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

<a href=file.htm#r ow200 target='src'> Row200 </a>
<a href=file.htm#r ow500 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 1625
pipjockey wrote:
I jump to this file with links from another window like:

<a href=file.htm#r ow200 target='src'> Row200 </a>
<a href=file.htm#r ow500 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
4917
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'); window.resizeTo(810,750); top.outerWidth=810;
6
4578
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 to tell if the window.onload event has already fired. I cannot edit the onload event handler itself, and my function can only exist in an external js file, sourced from the document's head section. Any ideas?
2
7678
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 like mine to run immediately after it. So in the code below, what JS would i need to add to my "myfile.inc" page so that I could guarantee this behavior? <!-- main page --> <html> <head> <script type="text/javascript">
3
1800
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 in header, thus: window.onload=function1;function2; but I just realized that only first function in this list gets called
3
3273
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 event? The following code does not work because I never recieve the OnLoad event. What am I doing wrong? public class frmMain : System.Windows.Forms.Form { protected virtual void OnLoad(EventArgs e)
3
9736
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
11548
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 screen until it done. so does this mean onload mean before form load? if I want after form load what should I do?
5
2795
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 save the contents of the form, and then I put an onload event to do a window.close. this works fine for hundreds of people on different browsers. However, for one user the window does not close.
7
2074
by: Q | last post by:
Question: why doesn't: window.onLoad = recalculate(); work, and do I have to use: window.onLoad = recalculate; (IE) ???
6
3139
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 images/names. However, I overcome this by executing what is usually the OnClick event on the OnLoad event instead. This works great in firefox - meaning there is no need to click the link to see the proper images and not the filler images - it just...
0
9471
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10136
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8958
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7478
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6723
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5501
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4036
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2867
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.