473,499 Members | 1,672 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

stopping the focus on a page from moving

I have a test page http://www.files.maproom.org/00/12/q/w.html which
almost does what I want.

The idea is that, when you hover the mouse over one of the dates near
the top of the page, it updates _both_ the appearance of the map, _and_
the text appearing in the iframes further down the page. I would like
it to do this smoothly; but each time you select a new page, the
browser window jerks down to the iframes (where the text was refreshed)
and back to the top of the page (where I have arranged for another
invisible iframe to be refreshed, to bring the focus back to the top).

Both Mozilla and IE show this behaviour (IE doesn't display the map
properly, but that's another problem which I can do nothing about).
Opera6 actually shows the behaviour I am looking for.

Can anyone suggest a way to refresh the contents of my iframes without
the focus going down there to look at them, however briefly? I have
tried putting a div round the iframes and temporarily making it hidden
while I do the refresh, but this doesn't help, the focus still goes to
look at the invisible iframes.

Nick
--
Nick Wedd ni**@maproom.co.uk
Dec 1 '05 #1
4 1818

Nick Wedd wrote:
I have a test page http://www.files.maproom.org/00/12/q/w.html which
almost does what I want.

The idea is that, when you hover the mouse over one of the dates near
the top of the page, it updates _both_ the appearance of the map, _and_
the text appearing in the iframes further down the page. I would like
it to do this smoothly; but each time you select a new page, the
browser window jerks down to the iframes (where the text was refreshed)
and back to the top of the page (where I have arranged for another
invisible iframe to be refreshed, to bring the focus back to the top).

Both Mozilla and IE show this behaviour (IE doesn't display the map
properly, but that's another problem which I can do nothing about).
Opera6 actually shows the behaviour I am looking for.

Can anyone suggest a way to refresh the contents of my iframes without
the focus going down there to look at them, however briefly? I have
tried putting a div round the iframes and temporarily making it hidden
while I do the refresh, but this doesn't help, the focus still goes to
look at the invisible iframes.

Nick
--
Nick Wedd ni**@maproom.co.uk


Looking at your changedate function, you are changing the "source"
through the use of the hash in the uri. This normally causes the page
to jump to where the named anchor is located. I would try placing the
individual dates in separate html pages instead so the jump does not
occur.

Dec 1 '05 #2
Nick Wedd wrote:
I have a test page http://www.files.maproom.org/00/12/q/w.html which
almost does what I want.

The idea is that, when you hover the mouse over one of the dates near
the top of the page, it updates _both_ the appearance of the map, _and_
the text appearing in the iframes further down the page. I would like
it to do this smoothly; but each time you select a new page, the
browser window jerks down to the iframes (where the text was refreshed)
and back to the top of the page (where I have arranged for another
invisible iframe to be refreshed, to bring the focus back to the top).

Both Mozilla and IE show this behaviour (IE doesn't display the map
properly, but that's another problem which I can do nothing about).
Opera6 actually shows the behaviour I am looking for.

Can anyone suggest a way to refresh the contents of my iframes without
the focus going down there to look at them, however briefly? I have
tried putting a div round the iframes and temporarily making it hidden
while I do the refresh, but this doesn't help, the focus still goes to
look at the invisible iframes.
Start by validating your page, you have 34 errors, many serious (a DIV
element inside a HEAD and others inside A elements).

<URL:
http://validator.w3.org/check?uri=ht...2%2Fq%2Fw.html

You also have:
<script language="JavaScript">
The language attribute is deprecated, type is required:

<script type="text/javascript">

<!--
Do not use HTML comment delimiters inside script tags, they peform no
useful function and are potentially harmful.

window.onresize = new Function("sifw()");


There is no need to create a new function object every time the page is
resized, you just want to run the existing function:

window.onresize = sifw;

--
Rob
Dec 1 '05 #3
In message <GJ****************@news.optus.net.au>, RobG
<rg***@iinet.net.au> writes
Nick Wedd wrote:
I have a test page http://www.files.maproom.org/00/12/q/w.html which
almost does what I want.
The idea is that, when you hover the mouse over one of the dates
near the top of the page, it updates _both_ the appearance of the
map, _and_ the text appearing in the iframes further down the page. I
would like it to do this smoothly; but each time you select a new
page, the browser window jerks down to the iframes (where the text
was refreshed) and back to the top of the page (where I have arranged
for another invisible iframe to be refreshed, to bring the focus back >>to the top).
Both Mozilla and IE show this behaviour (IE doesn't display the map
properly, but that's another problem which I can do nothing about).
Opera6 actually shows the behaviour I am looking for.
Can anyone suggest a way to refresh the contents of my iframes
without the focus going down there to look at them, however briefly?
I have tried putting a div round the iframes and temporarily making
it hidden while I do the refresh, but this doesn't help, the focus
still goes to look at the invisible iframes.
Start by validating your page, you have 34 errors, many serious (a DIV
element inside a HEAD and others inside A elements).


The DIV inside the HEAD has gone, that was a bodge made unnecessary by
web.dev's advice, which I have taken. Thank you, web.dev.

I have also rearranged things so that there is no longer a DIV element
inside an A element. Thank you for this advice.
<URL:
http://validator.w3.org/check?uri=ht...aproom.org%2F0
0%2F12%2Fq%2Fw.html
Thank you for recommending this. I shall run this page, and others,
through the validator.
You also have:
<script language="JavaScript">


The language attribute is deprecated, type is required:

<script type="text/javascript">


Ok, thank you, I have made that change.
<!--


Do not use HTML comment delimiters inside script tags, they peform no
useful function and are potentially harmful.


They _do_ perform a useful function (I am sure you know what it is), and
they seem to do no harm. But I accept that if someone looks at this
page with a browser that knows nothing about javascript, they aren't
going to have any joy anyway.
window.onresize = new Function("sifw()");


There is no need to create a new function object every time the page is
resized, you just want to run the existing function:

window.onresize = sifw;


This sounds like good advice. However,
window.onresize = new Function("sifw()");
works with Mozilla 1.6, Opera 6, IE6, and Firefox 1.0.7, while
window.onresize = sifw;
fails to work with any of these browsers, and moreover generates an
error message with IE6.

I have uploaded a new version of
http://www.files.maproom.org/00/12/q/w.html
incorporating various improvements, thanks to you and to web.dev;
also a version
http://www.files.maproom.org/00/12/q/ww.html
which incorporates your suggestion of using
window.onresize = sifw;
The sifw function is meant to cause the iframe panels, with German and
English text, to resize when the browser window is resized.

Nick
--
Nick Wedd ni**@maproom.co.uk
Dec 2 '05 #4
Nick Wedd wrote:
[...] RobG [...] writes
Nick Wedd wrote:
<!--
Do not use HTML comment delimiters inside script tags, they peform no
useful function and are potentially harmful.


They _do_ perform a useful function (I am sure you know what it is),


They do not. There is no compliant HTML UA out there that is allowed to
interpret the content of the `script' element as text (introduced in HTML
3.2, previous HTML versions being obsoleted and control about HTML passed
on to W3C by RFC2854 [June 2000]) , especially not within the `head'
element where _no_ text node is allowed to result in visible display.
and they seem to do no harm.
There is no standard or reference on how to parse such code in HTML.
Examples in the Specification are informative, not normative.

There is no standard or reference on how to parse such code in any
ECMAScript conforming implementation as `<', `!' and `--' are operators.
Strictly, it leads to a script SyntaxError if the parser correctly
considers the `script' element's content as CDATA that is _not_ to be
parsed (except of looking for the CDATA-closing ETAGO delimiter `</'.)

In XHTML, it is potentially harmful as that is an XML application. An XML
parser is allowed to remove all comments before building the parse tree.
<script ...><!-- ... --></script> results in <script .../>, an empty
`script' element. Calls to functions supposed-to-be declared in that
`script' element would result in a ReferenceError as they would not be
declared at all.

See also news:13****************@PointedEars.de
But I accept that if someone looks at this page with a browser that
knows nothing about javascript, they aren't going to have any joy
anyway.


That is not the issue. The support, i.e. the ability of parsers to
recognize the `script' element and to ignore it altogether with its
content if the required script support is not present, especially
not to display it within the `head' element, is the issue. That
support can be considered present nowadays while the opposite (that
those delimiters are either overlooked by the markup parser or the
script engine) cannot be considered present.
window.onresize = new Function("sifw()");


There is no need to create a new function object every time the page is
resized, you just want to run the existing function:

window.onresize = sifw;


This sounds like good advice. However,
window.onresize = new Function("sifw()");
works with Mozilla 1.6, Opera 6, IE6, and Firefox 1.0.7, while
window.onresize = sifw;
fails to work with any of these browsers, and moreover generates an
error message with IE6.


Syntactically, it does not. If it does, there is something wrong the
Function object referred to. What is wrong, probably tells the error
message you do not really tell about.

<URL:http://jibbering.com/faq/#FAQ4_43>
PointedEars
Dec 2 '05 #5

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

Similar topics

4
3502
by: Craig Bates | last post by:
Hi all I am designing a website for disabled football supporters and because of this, I obviously must consider accessibility to blind users whilst I am producing it - as they are one of the...
11
4450
by: JCO | last post by:
I have a text box, on my form that I cant get the focus on. I'm using it as shown: <head> <body onload=document.getPassword.txtPasswordName.focus()> </head> Where getPassword is the form &...
20
12266
by: Arne | last post by:
During testing <div style="overflow:auto;"> in CSS I noticed the mousewheel would work in Mozilla only after I made a <a href="#">some text</a> link and clicked on that, within the div. It...
14
4511
by: Mark | last post by:
Hi, At the top of my php file I have got :- <body onblur="self.focus();"> so when I click off onto another window, my window comes back up in front which is perfect. The problem however, is...
5
1985
by: Rob Lynch | last post by:
This one has me perplexed from vs.net web app add a new aspx pag add 3 textbox's and a command butto in the command buttons click event add response.write "button1 click from any textbox...
6
1375
by: Mike | last post by:
I have a few textbox controls that have autopostback so that when they loose focus they update a label control that shows the count of characters in their respective text control. This works fine,...
2
1424
by: Mark | last post by:
I have a form with two sub forms. The form is set to data entry. The form is bound directly to a table I have two buttons at the bottom of the screen. One button is named reject and one is named...
1
3221
by: google | last post by:
I have a form with several subforms. Users enter the data, then on the parent there is a command button that runs code to generate a .pdf document from a report based on the data they are working...
0
1907
by: jvitti | last post by:
I recently upgraded from Access 2000 to Access 2007 and I am having trouble with moving the focus from 1 form to another. While doing data entry if a similar claim is found the claim view form...
0
7131
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
7174
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
7220
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...
0
5470
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,...
1
4919
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...
0
4600
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...
0
3091
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
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 ...
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.