?
Solved

Javascript location

Posted on 2006-11-24
2
Medium Priority
?
502 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 16

Accepted Solution

by:
alain34 earned 1000 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 1000 total points
ID: 18008405
yes you can, see this link for complete information : http://www.w3schools.com/js/js_whereto.asp
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to count occurrences of each item in an array.
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).
Suggested Courses

771 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