Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. How to access arraylist in javascript

How to access arraylist in javascript

Scheduled Pinned Locked Moved Web Development
javascripttutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jophinmichael
    wrote on last edited by
    #1

    I am having an arraylist with string values stored in it.I want to access that arraylist in javascript so that i can manipulate the values stored in it.

    jophin

    G 1 Reply Last reply
    0
    • J jophinmichael

      I am having an arraylist with string values stored in it.I want to access that arraylist in javascript so that i can manipulate the values stored in it.

      jophin

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      That is impossible. The ArrayList exists in the server code, and Javascript is client code. You can't share objects between server code and client code. There are two reasons for this, which each by themselves makes it impossible: :: The server code and client code doesn't exist in the same place. :: The server code and client code doesn't exist at the same time. The server code runs on the server to create the web page. At this time the client code doesn't exist. The page is sent to the browser, and the client code is executed. At this time the server code is no longer running. If you want to send data from the server code to the client code, you put the data in the web page that is created. For example by creating Javascript code that recreates the data, or putting it in hidden fields in a form on the page. You can't send the data back to the server code that sent the data, as that code is no longer running. You have to make a new request to the server so that the execution of the code starts over. You have to send the manipulated data in the request, for example by putting it in hidden fields in a form and posting the form.

      --- single minded; short sighted; long gone;

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups