Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: Getting DataGrid HTML in Javascript


Message #1 by "Steven Bee" <steven_bee@h...> on Thu, 6 Feb 2003 18:43:29
Can anyone help me with this? I'm writing a piece of Javascript that 
attempts to extract the HTML for a datagrid so that it can be sent to 
Excel. I have a VBScript example of this. It is:

sHTML = document.forms(0).children("DataGrid1").outerhtml

I can't seem to figure out the equivalent document statement in javascript.

Any help would be appreciated.
Message #2 by "Van Knowles" <vknowles@s...> on Wed, 19 Feb 2003 20:24:26
I think what you need is:

sHTML = document.getElementById("DataGrid1").outerhtml;

(although I am not certain about the capitalization of outerhtml - there's 
probably an uppercase letter in it, and javascript is very case-sensitive)

-Van

> Can anyone help me with this? I'm writing a piece of Javascript that 
a> ttempts to extract the HTML for a datagrid so that it can be sent to 
E> xcel. I have a VBScript example of this. It is:

> sHTML = document.forms(0).children("DataGrid1").outerhtml

> I can't seem to figure out the equivalent document statement in 
javascript.

> Any help would be appreciated.

  Return to Index