List Info

Thread: Simple Question




Simple Question
user name
2006-05-27 18:04:25
I'm brand new to this, but I'd try

val = tds[6].innerHTML;

peace,
ted

On 5/27/06, A. Alfred Ayache <alfredlastbyte.ca> wrote:
> OK, I got the element I'm interested in, which happens
to be a TD.  Now I want
> the info inside it.  How do I lift it out?
>
> I tried
>
> val = tds[6].value;
>
> But that was undefined.
>
> Thanks,
>
> A. Alfred Ayache
> http://lphs76.ca        
    - Reunion community
> http://www.rentersPlus.com
   - Apartment Search
> http://www.lastbyte.ca    
  - Web Design, eCommerce, PHP/MySQL, Java, Oracle
>
>
> Daniel Sheets wrote:
> > Thanks again! You're very helpful.
> > _______________________________________________
> > Greasemonkey mailing list
> > Greasemonkeymozdev.org
> > http:
//mozdev.org/mailman/listinfo/greasemonkey
> >
> > --------------------------------
> > Spam/Virus scanning by CanIt Pro
> >
> > For more information see
> > http://www.
kgbinternet.com/SpamFilter.htm
> >
> > To control your spam filter, log in at
> > http://filter.kgbintern
et.com
> >
> >
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkeymozdev.org
> http:
//mozdev.org/mailman/listinfo/greasemonkey
>


-- 
Humanize the Earth!  http://tedernst.com
Open more space!  http://www.openspacewor
ld.org
Chicago event July 14-16: http://moreandmore.us/
skype: TedErnst
google talk/jabber: tedernstgmail.com
_______________________________________________
Greasemonkey mailing list
Greasemonkeymozdev.org
http:
//mozdev.org/mailman/listinfo/greasemonkey
Simple Question
user name
2006-05-27 18:15:41
That got me closer, Ted.  It returned

<span ...>data</span>

So, I'll do another getElementsByTagName('span') on that
and get the innerHTML 
from that one.

Is there a faster route?

Thanks, Ted!

A. Alfred Ayache
http://lphs76.ca            
- Reunion community
http://www.rentersPlus.com
   - Apartment Search
http://www.lastbyte.ca 
     - Web Design, eCommerce, PHP/MySQL, Java, Oracle
_______________________________________________
Greasemonkey mailing list
Greasemonkeymozdev.org
http:
//mozdev.org/mailman/listinfo/greasemonkey
Simple Question
user name
2006-05-27 19:43:40
On 5/27/06, A. Alfred Ayache <alfredlastbyte.ca> wrote:
> That got me closer, Ted.  It returned
>
> <span ...>data</span>
>
> So, I'll do another getElementsByTagName('span') on
that and get the innerHTML
> from that one.
>
> Is there a faster route?

Assuming the structure you're starting with is this:

<td ...><span ...>text you care
about</span></td>
and you have a references tds[6], then you want:

tds[6].firstChild.firstChild.textContent
_______________________________________________
Greasemonkey mailing list
Greasemonkeymozdev.org
http:
//mozdev.org/mailman/listinfo/greasemonkey
Simple Question
user name
2006-05-27 20:09:23
val = tds[6].textContent

Note: You may want to use Jesse Ruderman's Javascript Shell
[1] to explore
properties and methods of DOM objects.  Just write
"tds[6].", press "TAB"
for autocompletion, and voilą!, you get a list of the 107
properties and
methods of your object. A quick inspection suggests that
textContent is a
good candidate, and in fact it is the right one.

[1] http://www.squarefre
e.com/shell/

2006/5/27, A. Alfred Ayache <alfredlastbyte.ca>:
>
> That got me closer, Ted.  It returned
>
> <span ...>data</span>
>
> So, I'll do another getElementsByTagName('span') on
that and get the
> innerHTML
> from that one.
>
> Is there a faster route?
>
>
>
_______________________________________________
Greasemonkey mailing list
Greasemonkeymozdev.org
http:
//mozdev.org/mailman/listinfo/greasemonkey
Simple Question
user name
2006-05-27 20:44:41
Use the DOM Inspector. That will tell you what you need to
navagate in order 
to get to, I assume, the text node containting the data
you're looking for.


On 27 May 2006 at 14:15, A. Alfred Ayache wrote:

> That got me closer, Ted.  It returned
> 
> <span ...>data</span>
> 
> So, I'll do another getElementsByTagName('span') on
that and get the
> innerHTML from that one.
> 
> Is there a faster route?
> 
> Thanks, Ted!
> 
> A. Alfred Ayache
> http://lphs76.ca        
    - Reunion community
> http://www.rentersPlus.com
   - Apartment Search
> http://www.lastbyte.ca    
  - Web Design, eCommerce, PHP/MySQL, Java,
> Oracle _______________________________________________
Greasemonkey
> mailing list Greasemonkeymozdev.org
> http:
//mozdev.org/mailman/listinfo/greasemonkey
> 


_______________________________________________
Greasemonkey mailing list
Greasemonkeymozdev.org
http:
//mozdev.org/mailman/listinfo/greasemonkey
[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )