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. Advertisements

  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. Advertisements

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. Jason Coyne  Gaijin42
    Replies:
    0
    Views:
    501
    Jason Coyne Gaijin42
    Apr 4, 2004
  2. KavvY

    Accessing data in DataSet

    KavvY, Jul 13, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    4,660
    KavvY
    Jul 14, 2004
  3. =?iso-8859-1?Q?S=F8ren_Jensen?=

    Accessing data on a SQL-server

    =?iso-8859-1?Q?S=F8ren_Jensen?=, Jul 4, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    432
    dave wanta
    Jul 5, 2003
  4. Siva
    Replies:
    1
    Views:
    558
    =?Utf-8?B?UmljaA==?=
    Apr 17, 2006
  5. Ram
    Replies:
    3
    Views:
    542
    Barry Schwarz
    Mar 24, 2009
  6. Mauricio Fernandez
    Replies:
    0
    Views:
    229
    Mauricio Fernandez
    Jun 22, 2007
  7. Replies:
    4
    Views:
    374
  8. Omicron
    Replies:
    9
    Views:
    549
Loading...