473,387 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Help tidy up javascript code

http://www.lajzar.co.uk/unit/

Is an index page. I have javascripts to open up submenus. But tehre are
quiter a lot of them, all simialr. Is there a way to unify all that
javascript into a single function?
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Jul 20 '05 #1
3 2726
> http://www.lajzar.co.uk/unit/

Is an index page. I have javascripts to open up submenus. But tehre are
quiter a lot of them, all simialr. Is there a way to unify all that
javascript into a single function?
Sure...try this::

<HTML>
<HEAD>
<STYLE TYPE="text/css">
#anglo_ok { display: none; }
</STYLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
function Show(id1,id2) {document.getElementById(id1).style.display =
"block";document.getElementById(id2).style.dis play = "none"; return null;}
function Xejn() { }
-->
</SCRIPT>
</HEAD>
<BODY>

<TABLE BORDER WIDTH=100%>
<TR VALIGN=top><TD WIDTH=33%>

<DIV ID="anglo_ok">
<IMG SRC="../icon/hlp2.gif"><A HREF="javascript:Xejn()"
onclick="Show('anglo_no','anglo_ok')">Anglo-American Units</A><BR><P
CLASS="ind">
<IMG SRC="../icon/htm1.gif"><A HREF="system/imp_usa.html">US
Customary</A><BR>
<IMG SRC="../icon/htm1.gif"><A HREF="system/imp_brit.html">British
Imperial</A><BR>
<IMG SRC="../icon/htm1.gif"><A HREF="system/imp_intl.html">Modern
International</A><BR>
<IMG SRC="../icon/htm1.gif"><A HREF="system/imp_scot.html">Traditional
Scottish</A><BR>
<IMG SRC="../icon/htm1.gif"><A HREF="system/imp_eire.html">Traditional
Irish</A><BR></P>
</DIV>
<DIV ID="anglo_no">
<IMG SRC="../icon/hlp1.gif"><A HREF="javascript:Xejn()"
onclick="Show('anglo_ok','anglo_no')">Anglo-American Units</A><BR>
</DIV>
</table>

Please post next time the necesarry code...

Fabian
Visit my website often and for long periods!
Once and never again...
http://www.lajzar.co.uk

Jul 20 '05 #2

"Ang Talunin" <pl************@no-reply.com> wrote in message
news:10***************@halkan.kabelfoon.nl...

Please post next time the necesarry code...


Thats why I posted an url.
Fabian
Visit my website often and for long periods!


Once and never again...


I was going to thank you.
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk
Jul 20 '05 #3

"Fabian" <la****@hotmail.com> schreef in bericht
news:bm************@ID-174912.news.uni-berlin.de...

"Ang Talunin" <pl************@no-reply.com> wrote in message
news:10***************@halkan.kabelfoon.nl...

Please post next time the necesarry code...


Thats why I posted an url.


But if you posted an url, people first have to visit your page...get the
source,s trip it down to the problem and solve it. If you just post what you
want to be solved you will get a much faster reaction...
Jul 20 '05 #4

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

Similar topics

6
by: Mike Daniel | last post by:
I am attempting to use document.write(pageVar) that displays a new html page within a pop-up window and the popup is failing. Also note that pageVar is a complete HTML page containing other java...
11
by: Ed Blinn | last post by:
Can someone tell me where the problem here is? I can't get the "squared()" function to work properly...it supposed to put the squared value into the iframe area. Thanks, Ed <!DOCTYPE HTML...
12
by: Stefan Weiss | last post by:
Hi. (this is somewhat similar to yesterday's thread about empty links) I noticed that Tidy issues warnings whenever it encounters empty tags, and strips those tags if cleanup was requested....
2
by: Wilhelm Kutting | last post by:
hi, i like to solve a code-prob: tidy is bitching about <...> proprietary attribute "type" <...> lacks "action" attribute how can i make this nice? this is my code
16
by: expertware | last post by:
Dear friends, My name is Pamela, I do not know anything about javascript, but I would like to ask if it offers a solution to this problem of mine. I have an image on a web page within a css...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
0
by: Christoph Schneegans | last post by:
Hi! I'd like to present an easy, yet powerful approach to use the HTML Tidy program from <http://tidy.sourceforge.net/> in ASP.NET. It is similiar to...
40
by: VK | last post by:
Hi, After the response on my request from W3C I'm still unclear about Tidy vs. Validator discrepansies. That started with <IFRAME> issue, but there is more as I know. Anyway, this very basic...
36
by: aljamala | last post by:
Hi, I keep getting this warning on a page, but I do not know what the problem is...does anyone have an idea about what could be wrong? line 88 column 7 - Warning: missing </formbefore <td> it...
4
by: eBob.com | last post by:
I am trying to understand a bit of JavaScript from http://developer.yahoo.com/maps/simple/jspost.html (appended below). I'd appreciate help understanding two things it. The first is the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
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,...

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.