By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,384 Members | 1,794 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,384 IT Pros & Developers. It's quick & easy.

Javascript, HTML Elements, Parsing

P: n/a
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

Aug 2 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.getElementById("GanttTable");
if (isMethod(slice, "cloneNode"))
{
var sliceClone = slice.cloneNode(true);
if (sliceClone)
{
// ...
parentElementNode.appendChild(sliceClone);
}
}
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Aug 3 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.