Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 14 of 14
  1. #1
    New Coder
    Join Date
    Nov 2009
    Posts
    30
    Thanks
    2
    Thanked 0 Times in 0 Posts

    I need some JavaScript help * resolved*

    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
    Last edited by mdamon; 11-09-2009 at 05:21 PM.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Hi there,
    I'm interested to take this project. PMed you.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New to the CF scene
    Join Date
    Nov 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    are you still open ?

  • #4
    New Coder
    Join Date
    Nov 2009
    Posts
    30
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Below is the sample web page that I need to get the text from.

    http://nielsen-auto-group.ebizautos....d-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

  • #5
    New Coder
    Join Date
    Nov 2009
    Posts
    30
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Yes, still looking for help

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    So you will have direct access to the new site or will you be putting it inside of an iframe or something?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #7
    New Coder
    Join Date
    Nov 2009
    Posts
    30
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Yes, I have direct access to add html and javascript to the site.

  • #8
    Regular Coder hdewantara's Avatar
    Join Date
    Aug 2009
    Location
    Jakarta, Indonesia.
    Posts
    375
    Thanks
    9
    Thanked 55 Times in 54 Posts
    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.

  • #9
    New Coder
    Join Date
    Nov 2009
    Posts
    30
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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

  • #10
    Regular Coder hdewantara's Avatar
    Join Date
    Aug 2009
    Location
    Jakarta, Indonesia.
    Posts
    375
    Thanks
    9
    Thanked 55 Times in 54 Posts

    Cool

    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";

  • Users who have thanked hdewantara for this post:

    mdamon (11-09-2009)

  • #11
    New Coder
    Join Date
    Nov 2009
    Posts
    30
    Thanks
    2
    Thanked 0 Times in 0 Posts
    My question has been solved, that you everyone for your help!

    Marc Damon

  • #12
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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 you are getting paid to do a job, don't ask for help on it!||||

  • #13
    Regular Coder hdewantara's Avatar
    Join Date
    Aug 2009
    Location
    Jakarta, Indonesia.
    Posts
    375
    Thanks
    9
    Thanked 55 Times in 54 Posts
    Quote Originally Posted by _Aerospace_Eng_ View Post
    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.
    Last edited by hdewantara; 05-29-2013 at 09:36 AM.

  • #14
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    The thread at document.getElementsByClassName() gives a good way to extend the support of that DOM method in to all browsers
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    hdewantara (11-11-2009)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •