473,785 Members | 2,457 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multi-function Menu Question

Its perhaps a bit early to ask, since I'm still doing the page design
and haven't got down to the coding yet, but I wonder if anyone can help
with a bit of a question. To lay the groundwork, a quick description of
the template design for the pages:-

1. There will be a body section of the page consisting of a set of <div>
layers. The top level layers will all have the same CSS class to ensure
a common design look.

2. At the side or top of the page (not yet decided) there will be a
small number of navigation text phrases. These will be set up as
<a>ddress tags to that they can have events attached.

3. The events on the navigation menu will be "onClick" events and will
switch the layer they refer to to be visible (and the others to be
invisible, obviously).

4. The reference on the address tags should, I know, be of the form
"href='javascri pt:;'" to prevent page reloads when clicking on the menu
option since I have an "onLoad" event to set up the basic page. No
problem here - I've made pages like this loads of times.

5. Now comes the fun bit... I want the pages to be fully accessible to
anyone at all (which is why the menu is text rather than images in the
first place). That has to include people who do not have
JavaScript-enabled browsers.

So - I will start loading the page with all the <div> layers visible
(the onLoad event will switch off those not initially in use). These
will switch in and out of visibility for browsers using JavaScript. For
those who don't use JavaScript, the page will display with all layers
visible, of course, and for these users the menu options should go to
anchor points at the top of each top-level layer section.

Now - the question is, how can I use anchor points (of the form
"href='#anchorn ame'" and yet still prevent page-reloads when the menu
option is selected? I know that some browsers will not do page reloads
anyway, but I need to be sure that none will. Any ideas?
Jul 23 '05 #1
2 1727
Mark Preston wrote:
<snip>
4. The reference on the address tags should, I know, be of the form
"href='javascri pt:;'" to prevent page reloads when clicking on the
menu option since I have an "onLoad" event to set up the basic page.
No problem here - I've made pages like this loads of times.
Absolute rubbish. This group strongly and repeatedly discourages the use
of javascript pseudo protocol HREFs, partly because they offer no
facility for clean degradation (or meaningful actions without javascript
being enabled) and partly because they directly cause problems with some
browser and OS combinations:-

<URL: http://jibbering.com/faq/#FAQ4_24 >

And that particular formulation of a javascript pseudo protocol HREF -
"javascript :;" - can be demonstrated to directly produce internally
suppressed syntax errors on IE 4 & 5 (it probably produces them on later
versions but the facility for the demonstration was removed).
"javascript : void 0;" would be better as it will not represent a syntax
error (but preferably don't use javascript HREFs at all, ever).
5. Now comes the fun bit... I want the pages to be fully accessible to
anyone at all (which is why the menu is text rather than images in the
first place). That has to include people who do not have
JavaScript-enabled browsers.
You might consider that to be fully accessible it would be necessary to
facilitate keyboard navigation, and apparently not all javascript
capable/enabled browsers trigger onclick events when a currently focused
link is triggered via the keyboard (at least some older ones don't).
Doubling-up with a keydown/press event might be advisable (with
appropriate handling for the browsers that will trigger onclick in
addition to key events).

<snip> Now - the question is, how can I use anchor points (of the form
"href='#anchorn ame'" and yet still prevent page-reloads when the
menu option is selected? I know that some browsers will not do
page reloads anyway, but I need to be sure that none will. Any
ideas?


Placing a fragment identifier in the HREF is the most sensible thing to
do. It does not need to conflict with the javascript in the onclick
handler because the onclick handler is allowed to prevent the navigation
using the HREF by cancelling the click event, usually be returning false
from the handler (possibly with additional W3C DOM and IE specific
default action cancelling code).

See:-

<URL: http://www.litotes.demon.co.uk/js_info/pop_ups.html >

- for an example resembling what you are describing (note: the first
link will re-load the page with the script disabled and so can be used
to simulate interaction without javascript).

Richard.
Jul 23 '05 #2
Richard Cornford wrote:
Mark Preston wrote:
<snip>
4. The reference on the address tags should, I know, be of the form
"href='javasc ript:;'" [snip]
Absolute rubbish. This group strongly and repeatedly discourages the use
of javascript pseudo protocol HREFs, partly because they offer no
facility for clean degradation (or meaningful actions without javascript
being enabled) and partly because they directly cause problems with some
browser and OS combinations:-

I do know that... if you read on, you will see that the entire point of
the question is all *about* "clean degredation" rather than Javascript
HREFs. It just happens that - as I said - in the past I have used them a
lot (because they happen to be pretty much "built-in" to DreamWeaver MX)
and would prefer *not* to any more.
And that particular formulation of a javascript pseudo protocol HREF -
"javascript :;" - can be demonstrated to directly produce internally
suppressed syntax errors on IE 4 & 5 (it probably produces them on later
versions but the facility for the demonstration was removed).
"javascript : void 0;" would be better as it will not represent a syntax
error (but preferably don't use javascript HREFs at all, ever).
This is actually what I initially replaced my "javascript :;" references
with when the glitch in IE became clear. But it isn't good enough for
non-enabled browsers, which is why I want to go further... hence my
question in the first place.
5. Now comes the fun bit... I want the pages to be fully accessible to
anyone at all (which is why the menu is text rather than images in the
first place). That has to include people who do not have
JavaScript-enabled browsers.
You might consider that to be fully accessible it would be necessary to
facilitate keyboard navigation, and apparently not all javascript
capable/enabled browsers trigger onclick events when a currently focused
link is triggered via the keyboard (at least some older ones don't).
Doubling-up with a keydown/press event might be advisable (with
appropriate handling for the browsers that will trigger onclick in
addition to key events).

This is the sort of thing I've been looking for as an answer! I will
look into keyboard triggers and vocal triggers (vocal is likely to be
the most important, but either could apply). Thanks. <snip>
Now - the question is, how can I use anchor points (of the form
"href='#ancho rname'" and yet still prevent page-reloads when the
menu option is selected? I know that some browsers will not do
page reloads anyway, but I need to be sure that none will. Any
ideas?


Placing a fragment identifier in the HREF is the most sensible thing to
do. It does not need to conflict with the javascript in the onclick
handler because the onclick handler is allowed to prevent the navigation
using the HREF by cancelling the click event, usually be returning false
from the handler (possibly with additional W3C DOM and IE specific
default action cancelling code).

See:-

<URL: http://www.litotes.demon.co.uk/js_info/pop_ups.html >

- for an example resembling what you are describing (note: the first
link will re-load the page with the script disabled and so can be used
to simulate interaction without javascript).

Got it! That is EXACTLY the sort of link I was looking for. I've also
found out that the Mozilla core engine since version 0.7 has been
updated to stop a glitch it had that caused page reloads with some fixed
anchors, so that solves that one as well. Unfortunately, it does still
seem to do page reloads at fairly unpredictable times if you mess around
with keyup/keydown events. There's still a little trouble with Lynx, but
that should sort out this week.

Thanks for the ideas and link.
Jul 23 '05 #3

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

Similar topics

37
4898
by: ajikoe | last post by:
Hello, Is anyone has experiance in running python code to run multi thread parallel in multi processor. Is it possible ? Can python manage which cpu shoud do every thread? Sincerely Yours, Pujo
4
4676
by: Frank Jona | last post by:
Intellisense with C# and a multi-file assembly is not working. With VB.NET it is working. Is there a fix availible? We're using VisualStudio 2003 Regards Frank
12
3880
by: * ProteanThread * | last post by:
but depends upon the clique: http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=954drf%24oca%241%40agate.berkeley.edu&rnum=2&prev=/groups%3Fq%3D%2522cross%2Bposting%2Bversus%2Bmulti%2Bposting%2522%26ie%3DUTF-8%26oe%3DUTF-8%26hl%3Den ...
0
3789
by: frankenberry | last post by:
I have multi-page tiff files. I need to extract individual frames from the multi-page tiffs and save them as single-page tiffs. 95% of the time I receive multi-page tiffs containing 1 or more black and white CCITT4 compressed files (frames) inside the tiff. Every now and then I receive a mixture of black and white CCITT4 and JPEG compressed files, and sometimes just multi-page tiffs with JPEG only. The code runs great when dealing with the...
6
8183
by: cody | last post by:
What are multi file assemblies good for? What are the advantages of using multiple assemblies (A.DLL+B.DLL) vs. a single multi file assembly (A.DLL+A.NETMODULE)?
6
4896
by: Joe | last post by:
I have 2 multi-list boxes, 1 displays course categories based on a table called CATEGORIES. This table has 2 fields CATEGORY_ID, CATEGORY_NAME The other multi-list box displays courses based on a table called COURSES. This table has 2 fields CATEGORY_ID, COURSE_NAME. The CATEGORY_ID is a FK in COURSES and a PK in CATEGORIES. I want to populate the course list box based on any category(s)
4
17878
by: mimmo | last post by:
Hi! I should convert the accented letters of a string in the correspondent letters not accented. But when I compile with -Wall it give me: warning: multi-character character constant Do the problem is the charset? How I can avoid this warning? But the worst thing isn't the warning, but that the program doesn't work! The program execute all other operations well, but it don't print the converted letters: for example, in the string...
5
6000
by: Shane Story | last post by:
I can seem to get the dimensions of a frame in a multiframe tiff. After selecting activeframe, the Width/Height is still really much larger than the page's actual dimensions. When I split a TIFF to several PNG files this causes a problem, becuase the resulting image is (the page to the far left and a lot of black space surrounding it and a filesize that is larger than needed. Any ideas?
0
2329
by: Sabri.Pllana | last post by:
We apologize if you receive multiple copies of this call for papers. *********************************************************************** 2008 International Workshop on Multi-Core Computing Systems (MuCoCoS'08) Barcelona, Spain, March 4 - 7, 2008; in conjunction with CISIS'08. <http://www.par.univie.ac.at/~pllana/mucocos08> *********************************************************************** Context
1
9319
by: mknoll217 | last post by:
I am recieving this error from my code: The multi-part identifier "PAR.UniqueID" could not be bound. The multi-part identifier "Salary.UniqueID" could not be bound. The multi-part identifier "PAR.UniqueID" could not be bound. The multi-part identifier "PAR.PAR_Status" could not be bound. The multi-part identifier "Salary.New_Salary" could not be bound. The multi-part identifier "Salary.UniqueID" could not be bound. The multi-part...
0
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10091
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8972
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...
0
6739
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
5381
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
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4050
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
2
3645
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.