Problem: Altering cell content in a on demand

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

  •   Subject
  • Author
  • Posted on
on demand
  • edwin Boyette
  • 09-04-2003
  • on demand
  • Bagbourne
  • 09-06-2003
  • I would like to be able to set the content of a cell " <TD> <TD> "  = to a
    variable, most likely store the data or content in an array, and then write
    the data in reponse to an action.  Any thoughts on this I have been poking
    around all over the place and couldn't find a solution.

    Re: Problem: Altering cell content in a

    on demand
    Michael Wilcox wrote:
    Quoted text here. Click to load it

    edwin, they are all taking about server-side modification of the page. A
    reload of the page. You can't have poked around much to miss Javascript!

    You can use Javascript manipulation of the document to achieve the same
    thing within the client browser without reloading the page - provided
    that your user has a javascript enabled browser. It depends on the
    environment that your users have.

    Have a look at
    appendinx D, "ECMA Script Language Binding". (ECMA script being the
    standardized version which most Javascript adheres to)

    You can access all elements of the document.

    <td id="mycell">
    <script type="text/javascript">
    var cell = document.getElementById("mycell");

    Remove all child nodes from the cell, and add the ones you want.

    To create a text node to append to the cell, use
    document.createTextNode("hello world");

    For more help on this, take it to comp.lang.javascript.


    Site Timeline