wood burning stoves 2.0
The moose likes HTML, CSS and JavaScript and the fly likes global veriable + hyper link Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "global veriable + hyper link" Watch "global veriable + hyper link" New topic

global veriable + hyper link

Naresh Chaurasia
Ranch Hand

Joined: May 18, 2005
Posts: 361
Hi , i have defined global variable in javascript.

var language="java";

I hava a hyperlink

<a href="/fil.jsp">language</a>

when i click at the above link, i am calling a javascript function. I want to append the var language to the hyperlink so that when i do request.getParemeter("language") in servlet i can access value "java".

How can i implement it.....

thnx in advance

SCJP 1.4, SCWCD1.4, OCA(1Z0-007)
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
why is it not appended by the serverside code in the first place?

You will have to either do a document.write to get it on there (again server is better) or you need to write a function that does this. Such as

Naresh Chaurasia
Ranch Hand

Joined: May 18, 2005
Posts: 361
thnx Eric. I am not appending it at server side since, I am trying to implement the following functionality :

Fetching multiple records from DB. At a time i show 5 records on the screen using for loop. When the user click <<first , <previous, next> , last>>, the same screen is loaded with different records using the for loop. depending upon which link is clicked, i have to assign different values to the starting and ending condition of for loop, which i am trying to append to the url clicked.

I hope I have answered your question.
I agree. Here's the link: http://aspose.com/file-tools
subject: global veriable + hyper link
It's not a secret anymore!