Using <noscript> if javascript disabled

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
iain_s
Advanced
Advanced
Posts: 15
Joined: Tue Oct 26, 2004 11:55 am
Location: Stafford, England
Contact:

Using <noscript> if javascript disabled

Post by iain_s »

I've just created my first menu and I'm impressed with the product. I'm now setting up an alternative menu for 'js disabled' .

Simple question (I 'm sure I should know the answer) - I've got the alternative menu defined in <_noscript> <_/noscript> code. How do I stop the block with the 'js enable code' displaying ?

I feel I want a
if <-noscript>
.....
else
....
type of construct

I've looked at some of the forum entries but can't think of an easy way to do it.
Iain
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Re: Using <noscript> if javascript disabled

Post by John »

iain_s wrote:Simple question (I 'm sure I should know the answer) - I've got the alternative menu defined in <_noscript> <_/noscript> code. How do I stop the block with the 'js enable code' displaying ?
I'm not exactly sure what you're asking (it's early here!). Simply set up your alternate menu within <noscript></noscript> tags (what you have above is incorrect). If JS if off that code will be shown.
John
iain_s
Advanced
Advanced
Posts: 15
Joined: Tue Oct 26, 2004 11:55 am
Location: Stafford, England
Contact:

Post by iain_s »

I have a table that includes the images and text that call the js menu - I would like this table to be ignored when js is disabled..

The alternative menu displays fine but I still see the 'prompt' for the main menu.
Iain
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

A URL would help.
John
iain_s
Advanced
Advanced
Posts: 15
Joined: Tue Oct 26, 2004 11:55 am
Location: Stafford, England
Contact:

Using <noscript> if javascript disabled

Post by iain_s »

See http://www.doxeyca.org.uk/dm_history.htm

The index page has a table containing direct links - subsidiary pages use Milonic menu.

If js disabled - this table is repeated on subsidiary pages but other prompts remain.
Iain
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

I see you went to all the trouble of setting up images of text, and yet my best suggestion is to not use images and just use menu text. Then apply noscript tags.

I only know the noscript tag, maybe there is another for an if - else statement that I don't know about.

Did you try surrounding it with noscript and that's what you are saying that the images still showed through?

I was hoping someone might know more than me.

maz
iain_s
Advanced
Advanced
Posts: 15
Joined: Tue Oct 26, 2004 11:55 am
Location: Stafford, England
Contact:

Using <noscript> if javascript disabled

Post by iain_s »

Sorry I haven't explained this very well.

For my milonic menu I used menu '24' when the menu is positioned to a 1-pixel image. I then placed 4 sub-menus in a (resizable) table (Table 1) stretching across the screen. This works fine.

When js is disabled I have placed another table (Table 2) above this enclosed in <noscript> </noscript> tags. This also works fine when js is disabled. However Table 1 is still visible and taking up screen space. See url http://www.doxeyca.org.uk/dm_history.htm
Iain
Leeson
Advanced
Advanced
Posts: 19
Joined: Tue Aug 10, 2004 12:23 pm

Post by Leeson »

This might be totally stupid (im no html wiz), but is it not possible to comment out the table in <noscript> tags?

Ie:

Code: Select all

<noscript><!--</noscript>
<table>
<tr>
<td>
menuscript
</td>
</tr> 
</table>
<noscript>--></noscript>
iain_s
Advanced
Advanced
Posts: 15
Joined: Tue Oct 26, 2004 11:55 am
Location: Stafford, England
Contact:

Post by iain_s »

Nice idea but the first "</noscript>" isn't seen because the comment hasn't closed ("-->")

Therefor the whole table is always in a "<noscript> </noscript>" block
Iain
Post Reply