Accessing TDC data

Discussion in 'Javascript' started by imaband, Nov 14, 2004.

  1. imaband

    imaband Guest

    Hello,

    I'm using a TDC to grab data from a CSV file. Here is the DSO
    declaration.

    <object id="qa_data"
    classid="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83">
    <param name="DataURL" value="QA_Data.csv" />
    <param name="UseHeader" value="True" />
    </object>

    Then I consume the data using the following HTML:

    <div id="answer" datasrc="#qa_data" datafld="Answer"
    dataformatas="text">

    Never fear, it displays the correct data just
    fine..................but...

    How do I programmatically access the VALUE of the above div field from
    javascript? I tried

    document.getElementById("answer").value;

    which does not work. I then tried to access the value using the
    recordset collection but the only documentation on the web that I can
    find is specific to VBScript or anything but JavaScript.

    Thanks,

    imaband
     
    imaband, Nov 14, 2004
    #1
    1. Advertising

  2. imaband

    Ivo Guest

    "imaband" wrote
    >
    > <div id="answer" datasrc="#qa_data" datafld="Answer"
    > dataformatas="text">
    >
    > How do I programmatically access the VALUE of the above div field from
    > javascript? I tried
    >
    > document.getElementById("answer").value;
    >


    I don't know about datasrc's, but a div is a div and div's don't have
    values.
    Try:

    document.getElementById("answer").firstChild.nodeValue;

    if you expect the first child to be a text node.
    HTH
    --
    Ivo
     
    Ivo, Nov 15, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Siva
    Replies:
    1
    Views:
    465
    =?Utf-8?B?UmljaA==?=
    Apr 17, 2006
  2. Ram
    Replies:
    3
    Views:
    433
    Barry Schwarz
    Mar 24, 2009
  3. Mauricio Fernandez
    Replies:
    0
    Views:
    128
    Mauricio Fernandez
    Jun 22, 2007
  4. Replies:
    4
    Views:
    260
  5. Omicron
    Replies:
    9
    Views:
    401
Loading...

Share This Page