/    Sign up×
Community /Pin to ProfileBookmark

How to get the link that was clicked even after the page gets refreshed

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 = “&nbsp;”;
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.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@aruktiauthorAug 26.2005 — Is there a solution for this in javascript?
×

Success!

Help @arukti spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...