• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

global veriable + hyper link

 
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi , i have defined global variable in javascript.

var language="java";

I hava a hyperlink

[code]
<a href="/fil.jsp">language</a>
[code]

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
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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




Eric
 
Naresh Chaurasia
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Did you just should on me? You should read this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic