Help coderanch get a
new server
by contributing to the fundraiser
  • 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

How to access javascript variable of one file in another jsp file

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have 2 jsp files and both have some javascript code.
In one of the jsp file i have a javascript variable whose value i need to assign to another javascript variable in my other jsp file.

How can i do that??

Please let me know if its not clear!!!
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JSP files, which reside and are interpreted on the server, have no relationship to one another as far as your client side (Javascript) code is concerned.

This article might help to clarify this for you.
http://www.javaranch.com/journal/200510/Journal200510.jsp#a1

If not, post back and let us know a little more about your JSP pages.
Is one included in the other? Are they in frames? How are loading both of them into the browser at the same time?
[ November 11, 2008: Message edited by: Ben Souther ]
 
All of the following truths are shameless lies. But what about this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic