Results 1 to 3 of 3

Thread: Insert into an array list

  1. #1
    Join Date
    Oct 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Insert into an array list

    I am currently working on a schedule function. I do not have a database. So i am trying to insert the data from the form into an array list. But i do not have any idea on how to insert the data into the array list. Is there any way to do this ? Thanks

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,941
    Thanks
    43
    Thanked 3,193 Times in 3,156 Posts
    Blog Entries
    12

    Default

    Javascript is no substitute for a database. That said, you can easily create an array:

    Code:
    var a = [];
    Then you can insert things into it:

    Code:
    a.push('Hey There!');
    The problem (if you are looking at this as a database) is that after the page is unloaded, a will no longer be defined, and the 'Hey There' that was pushed into it will be lost. On a limited basis, some stuff like this can be preserved in a javascript client side cookie, but those may be disabled or erased easily by users, sometimes inadvertently. This is in contrast to a server side database which can only be altered by the user as you allow.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Apr 2009
    Location
    Cognac, France
    Posts
    400
    Thanks
    2
    Thanked 57 Times in 57 Posts

    Default

    If you have a need to preserve the input, without using a database, then you could try doing this using a 'flat' file, eg csv

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •