Javascript, HTML Elements, Parsing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Yin99

    Javascript, HTML Elements, Parsing

    in my html I have a table I would like to "slice out" and then open
    new browser and write to a clean document window. Is there an easy
    way to do this in Javascript? The item I would like to slice outhas
    an id "GanttTable " and class "ms-ganttInnerTable ". Be nice if
    Javascript could just grab this element based on this id or class,
    store to string and let me write somewhere else.

    <table cellPadding="0" cellSpacing="0" id="GanttTable " class="ms-
    ganttInnerTable " >

    Thanks,
    Yin



  • Thomas 'PointedEars' Lahn

    #2
    Re: Javascript, HTML Elements, Parsing

    Yin99 wrote:
    in my html I have a table I would like to "slice out" and then open
    new browser and write to a clean document window. Is there an easy
    way to do this in Javascript? The item I would like to slice outhas
    an id "GanttTable " and class "ms-ganttInnerTable ". Be nice if
    Javascript could just grab this element based on this id or class,
    store to string and let me write somewhere else.
    RTFM, STFW.

    Serialization to a string should only be used if the DOM does not support
    cloneNode().

    var slice = document.getEle mentById("Gantt Table");
    if (isMethod(slice , "cloneNode" ))
    {
    var sliceClone = slice.cloneNode (true);
    if (sliceClone)
    {
    // ...
    parentElementNo de.appendChild( sliceClone);
    }
    }


    PointedEars
    --
    var bugRiddenCrashP ronePieceOfJunk = (
    navigator.userA gent.indexOf('M SIE 5') != -1
    && navigator.userA gent.indexOf('M ac') != -1
    ) // Plone, register_functi on.js:16

    Comment

    Working...