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 9131443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:08:32+00:00 2026-06-17T08:08:32+00:00

Here is some output that I get from firebug <div id=’div_undefined’>[{Region:AD,Date:,ArticleID:abc-345}, {Region:CD,Date:,ArticleID:abc-345}]</div> You can

  • 0

Here is some output that I get from firebug

<div id='div_undefined'>[{"Region":"AD","Date":"","ArticleID":"abc-345"},    {"Region":"CD","Date":"","ArticleID":"abc-345"}]</div>

You can see the JS Object array in there and notice the div_undefined. If you look at the funciton below I know that my object is defined because it is printing out. Why would Items[0] return undefined when I try to access ArticleID

here is the code from my function

function myFunc(Items){
    var item = Items[0];
    Write("<div id='div_" + item.ArticleID + "'>" + Items + "</div>");
}
  • 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-17T08:08:33+00:00Added an answer on June 17, 2026 at 8:08 am

    If concatenating Items produces this output, then it’s a string (containing JSON) and you have to parse it to a JS data structure first (an array in this case):

    function myFunc(Items){
        Items = JSON.parse(Items);
        var item = Items[0];
        Write("<div id='div_" + item.ArticleID + "'>" + Items + "</div>");
        // Will output
        // <div id='div_abc-345'>[object Object], [object Object]</div>
    }
    

    Ideally you would do this before you pass the value to the function. I don’t know which output you are after, so that’s all I can advice.


    Otherwise, Items[0] refers to the first letter of the string (a string as well) and strings don’t have an ArticleID property, hence you get undefined.


    You might find this question helpful as well: Access / process (nested) objects, arrays or JSON And as mentioned by Matt (and in the other question), if you want to debug your code, use console.log.

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

Sidebar

Related Questions

Does the latest version of MacRuby support static compilation? Here's some terminal output from
Here is some dprofpp -I output, for almost the same program on different input
Here's the output. These are utf-8 strings I believe... some of these can be
Here are some outputs: Date.today => Mon, 25 Jun 2012 Date.today.to_formatted_s(:long_ordinal) => June 25th,
I'm trying to get console output from a program using this library uZpRunConsoleApp .
Here's the problem. I am using AVCaptureVideoDataOutput to get video frames from camera and
I'm reading in from a text file that contains some assembly instructions that look
I have this output(from another system) that I need the Test field to be
I am trying to get output from a subprocess and then give commands to
I'm trying to figure out some Bash-foo to check that the output of three

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.