•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 392,022 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,268 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 2926 | Replies: 1
![]() |
•
•
Join Date: Jul 2005
Posts: 11
Reputation:
Rep Power: 4
Solved Threads: 0
Hello,
I have a menu.jsp included in all the jsps. When I click a link in the menu it calls the respective page and the menu.jsp is also refreshed.
I want to write a java script to highlight the menu link that was clicked. But since the menu jsp is refreshed every time a link is clicked I am not able to show the highlighted link.
Below is the script I am using to highlight the menu link that is clicked
<script type="text/javascript" language="JavaScript">
var lastrowObj="";
function addArrow(rowObj){
if(lastrowObj != ""){
lastrowObj.cells[0].innerHTML = " ";
lastrowObj.cells[1].getElementsByTagName('A')[0].className = "greybg";
for(j=0;j<rowObj.cells.length;j++){
lastrowObj.cells[j].className = "greybg";
}
}
rowObj.cells[0].innerHTML = "<img height=7 src='images/rezadminimages/arrow.gif' width=12>";
rowObj.cells[1].getElementsByTagName('A')[0].className = "highlight";
for(i=0;i<rowObj.cells.length;i++){
rowObj.cells[i].className = "highlight";
}
lastrowObj=rowObj;
}
</script>
Is there any way I can get the value of the link that was clicked even after the page is refreshed.
I have a menu.jsp included in all the jsps. When I click a link in the menu it calls the respective page and the menu.jsp is also refreshed.
I want to write a java script to highlight the menu link that was clicked. But since the menu jsp is refreshed every time a link is clicked I am not able to show the highlighted link.
Below is the script I am using to highlight the menu link that is clicked
<script type="text/javascript" language="JavaScript">
var lastrowObj="";
function addArrow(rowObj){
if(lastrowObj != ""){
lastrowObj.cells[0].innerHTML = " ";
lastrowObj.cells[1].getElementsByTagName('A')[0].className = "greybg";
for(j=0;j<rowObj.cells.length;j++){
lastrowObj.cells[j].className = "greybg";
}
}
rowObj.cells[0].innerHTML = "<img height=7 src='images/rezadminimages/arrow.gif' width=12>";
rowObj.cells[1].getElementsByTagName('A')[0].className = "highlight";
for(i=0;i<rowObj.cells.length;i++){
rowObj.cells[i].className = "highlight";
}
lastrowObj=rowObj;
}
</script>
Is there any way I can get the value of the link that was clicked even after the page is refreshed.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JSP Marketplace
Similar Threads
- Loading External Pages (IT Technologies and Trends)
- Clicked Link Countdown (HTML and CSS)
- WLAN Frequent "page cannot..." and slow loading. Please read. (Networking Hardware Configuration)
- Bookmark when closing browser. (HTML and CSS)
- Javascript form managment on the fly! (JavaScript / DHTML / AJAX)
- pyapal - i am unable to make payment through it - urgent help needed (eCommerce)
- Another HotOffers Hijack (HJT log incl) (Viruses, Spyware and other Nasties)
- I Need Help With Frames Please (HTML). (HTML and CSS)
- Home page gets directed to index page (Viruses, Spyware and other Nasties)
Other Threads in the JSP Forum
- Previous Thread: How to store javascript variable in jsp session
- Next Thread: JSTL compare string


Linear Mode