Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8117707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:15:40+00:00 2026-06-06T04:15:40+00:00

so i have a .js file that 2 different jsp pages call. .js file

  • 0

so i have a .js file that 2 different jsp pages call.

.js file contains:

var savedObj;

function A(obj){ savedObj = obj);

function B(){ alert(savedObj);

X.jsp file calls function A such that a DOM element onchange = functionA(this);

Y.jsp file calls function B such that body onload = function B

For some reason, my debugging in function A shows that the assignment of savedObj = obj worked correctly, but in function B, savedObj printed out null.

Thanks guys

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T04:15:42+00:00Added an answer on June 6, 2026 at 4:15 am

    Using a cookie to store the value is certainly the best way to make the value persist across various pages. If you don’t want to go into cookies, you could use javascript to write the new page in place of the current page and keep the value, but it’s messy and you’re better off taking the time to learn cookies.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a spring web application with jsp pages that calls different web services
I have a index.jsp file that has two different types of forms <form action=searchpath
Me again... I have an XML File that contains different categories which I would
In short, I have a 20,000,000 line csv file that has different row lengths.
I have two different modules that need access to a single file (One will
Assume that we have 3 different activities. Each activity has its own XML file
I have a file that contains a 16 character long sequence of UTF-8 which
I have a file that contains the output of a file compare thats written
I have a file that has many #define statements such as - #ifndef UTILITY_H
I have to file that has different types of lines. I want to select

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.