Solved

Javascript location

Posted on 2006-11-24
2
498 Views
Last Modified: 2013-11-19
Hi,

I want to handle a menu (highlighting item when user click on the item) with javascript.
can I put the javascript code just before the html code of the menu ?

I'm asking this because the menu is in a separate jsp file.

**** menu_top.jsp ****

<div id="menu_top">
      <div>
            Manage:
            <ul>
                        <li><a href="/users">Users</a></li>
                        <li ><a href="Setup?do=menu_collections">Collections</a></li>
                        <li><a href="/indexes">Mode Test</a></li>
                        <li><a href="Setup?do=menu_options">Options</a></li>
            </ul>
      </div>
      <hr class="separator"/>
</div>


**** collections.jsp (including the menu) ****

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>
<HEAD>

<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="IBM WebSphere Studio">
<META http-equiv="Content-Style-Type" content="text/css">
<LINK href="theme/master.css" rel="stylesheet" type="text/css">
<LINK href="theme/header.css"  rel="stylesheet" type="text/css">
<LINK href="theme/menu_top.css"  rel="stylesheet" type="text/css">
<LINK href="theme/menu_left_index.css"  rel="stylesheet" type="text/css">
<LINK href="theme/footer.css"  rel="stylesheet" type="text/css">
<TITLE>Fortis Crawler Admin</TITLE>
</HEAD>
<BODY id="body">

      <jsp:include page="incl/header.jsp"/>
      <jsp:include page="incl/menu_top.jsp"/>
      <jsp:include page="incl/menu_left_index.jsp"/>
   [...]



Thank u.
0
Comment
Question by:matthew016
2 Comments
 
LVL 16

Accepted Solution

by:
alain34 earned 250 total points
ID: 18008005
yes, javascript can be set anyware in the html document if you are declaring function. However, if it is not a function, the code will be executed straight away.
0
 
LVL 3

Assisted Solution

by:Masoudgh
Masoudgh earned 250 total points
ID: 18008405
yes you can, see this link for complete information : http://www.w3schools.com/js/js_whereto.asp
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question