This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes JSP and the fly likes Accessing javascript array inside a div. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Accessing javascript array inside a div." Watch "Accessing javascript array inside a div." New topic
Author

Accessing javascript array inside a div.

Rui Felix
Greenhorn

Joined: Jun 13, 2006
Posts: 8
Hello all,

I'm having the following problem, I'm using AJAX to make a request to the server when I'm building the response I'm using a lot of javascript to be able to populate the checkboxes and handle information in Arrays. When I receive the response in my principal JSP I catch the response and put it in a DIV tag with the innerHTML property. Until here everything is ok and working fine but then the problems start :
1 : The HTML displayed doesn't have any check box selected. When I know that all check boxes has to be selected.
2 : Can't access to any array created by java script.

My real problem is that I can't access any javascript variables that I declare in the built response and that I set in the div.

Example of what I have:

RESPONSE in a JSP built like a XML FILE:


Now really simple question I think, how can I access to the variable CheckedArray in the principal JSP.

I thought it was interpreted like a local variable.

Thanks All
Texugo
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60046
    
  65

Moved to the HTML/Javascript forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Accessing javascript array inside a div.
 
Similar Threads
How does upload multiple files work
Undefined Array Problem
Accessing javascript array inside a div.
Drop Downs
can't access iframe variable but can call iframe method