By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,715 Members | 1,815 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,715 IT Pros & Developers. It's quick & easy.

stopping the focus on a page from moving

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a

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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.