...

View Full Version : I need some JavaScript help * resolved*



mdamon
11-08-2009, 03:49 PM
1) Project Details: (be as specific as possible): I have a template auto dealer website and I am trying to get a section of text from the site. I have had this program running for a year now using getElementById and innerHTML, however, my website company is changing the layout of the site and the line of text that I need from the site is no longer nested in an id or tag. I am sure there is a way to get at this text and get it into a variable, but I can't figure it out.

2) Payment Amount: Under $50

3) Payment method/ details (Paypal, check? Timeline?): Paypal

4) Additional Info (about project or potential bidders): If you think you can do this, let me know and I will send you a sample website page that I need the text extracted from and answer any other questions you may have.

Thanks for your time,

Marc Damon

abduraooft
11-08-2009, 04:17 PM
Hi there,
I'm interested to take this project. PMed you.

awebgeek
11-08-2009, 04:28 PM
are you still open ?

mdamon
11-08-2009, 04:44 PM
Below is the sample web page that I need to get the text from.

http://nielsen-auto-group.ebizautos.com/detail-2010-ford-edge-limited-4753842.html

The vin number on this page (2FMDK3KCXABA01544) is the text that I need to get into a variable.

My current site has this info in an ID and I use getElementById and the innerHTML property to get it, but this is a sample of what the coding will be when my website company switches over to their new site and the vin number is not in an Id or tag name any more.

If this is something you can do, let me know cost and I can pay via paypal.

I also have several other small projects that I need help on if this goes good.

Thanks!
Marc Damon

mdamon
11-08-2009, 04:50 PM
Yes, still looking for help

_Aerospace_Eng_
11-08-2009, 07:20 PM
So you will have direct access to the new site or will you be putting it inside of an iframe or something?

mdamon
11-08-2009, 08:05 PM
Yes, I have direct access to add html and javascript to the site.

hdewantara
11-08-2009, 08:54 PM
Hi,
Why is it impossible to just enclose the number with the SPAN tag and give it an ID? It would be the easiest method.

Harder way? Have you tried using existing DIV with ID="DescriptionNarrow" and search its INNERHTML strings for "VIN:" ?

Warm regards,
Hendra D.

mdamon
11-08-2009, 09:34 PM
The website is a template site that I did not build and I can not add Ids to the HTML code that is already their. I do have access to add html and javaScript to sections of this site, but I do not have control to change code.

I have tried using InnerHTML with the ID descriptionNarrow, however the vin number is after two closing div tags and the innerHTML does not make it to the vin number.

Is their code that gets the next section of code after an id?

If someone comes up with a solution let me know how much.

Thanks again for the help!

Marc

hdewantara
11-09-2009, 06:52 AM
Hmm..
This might be tricky, and experimental,
but at least I could get a sort of data like this:
...
f[0]=VIN:
f[1]=
f[2]=
f[3]=
f[4]=
f[5]=
f[6]=2FMDK3KCXABA01544
f[7]=
f[...]=
...

by using a few lines of script:

var
b=document.getElementsByClassName("DescriptionWrapper");
c=b[0].textContent;
d=c.substr(c.indexOf("VIN"),40);
f=d.split("\t");
g="";
for (var i=0; i<f.length; i++){
g+="f["+i+"]="+f[i]+"\n";

mdamon
11-09-2009, 03:31 PM
My question has been solved, that you everyone for your help!

Marc Damon

_Aerospace_Eng_
11-11-2009, 09:34 AM
Have you tested the code provided for you in other browsers? I'm pretty sure document.getElementsByClassName has only been implemented fully in Firefox and Opera. Possibly just Firefox.

hdewantara
11-11-2009, 03:09 PM
Have you tested the code provided for you in other browsers? I'm pretty sure document.getElementsByClassName has only been implemented fully in Firefox and Opera. Possibly just Firefox.

If I may...
I am not sure which versions of browsers have suppported getElementsByClassName(),
and also which DOM the getElementsByClassName() belongs to,
I always get dizzy reading the spec by W3ORG :).

So I test a page (attached) to my browsers collection,
just to make sure:
a) FF 3.5.3 supports it.
b) Safari 4.0 too.
c) Opera 9.6.4 too.
d) IE 8 DOES NOT.

Hendra D.

abduraooft
11-11-2009, 03:16 PM
The thread at http://codingforums.com/showthread.php?t=154727 gives a good way to extend the support of that DOM method in to all browsers



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum