HighDots Forums  

How can I scan the whole page of the website then put the correctdata to each variables?

JavaScript discussion (multi-lingual) JavaScript discussion (alt.comp.lang.javascript)


Discuss How can I scan the whole page of the website then put the correctdata to each variables? in the JavaScript discussion (multi-lingual) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
rhhhmon
 
Posts: n/a

Default How can I scan the whole page of the website then put the correctdata to each variables? - 02-21-2009 , 01:22 PM






Hey guys,

So here's my problem. I want to scan the whole page of the website.
I'm trying to locate 2 datas, then I will put each data into a
separate variable.

var listitem, thislist, itemname1, itemname2;
listitem = getElementsByClass('-list-item');
for(var i = 0; i < listitem.length; i++) {
if(listitem[i].innerHTML.match(/Item Name:/)) {
itemname1 = listitem[i];
}
}

When the for loop scanned the whole -list-item class, and if it find
the Item Name: string then it will put that to itemname1. However,
there's another Item Name: string in the website. So I need to put the
other one to itemname2.

I don't know how to do that. I'm pretty newbie boss! Please tell me
how to do that and I'll remember it forever!

Raymond


Reply With Quote
  #2  
Old   
RickMerrill
 
Posts: n/a

Default Re: How can I scan the whole page of the website then put the correctdata to each variables? - 07-12-2009 , 07:39 PM






rhhhmon wrote:
Quote:
Hey guys,

So here's my problem. I want to scan the whole page of the website.
I'm trying to locate 2 datas, then I will put each data into a
separate variable.
....

You might use switch(C){\n
and use case to id the data - that's what I do

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.