Web Analytics Made Easy -
StatCounter Picking up href from within table column - CodingForum

Announcement

Collapse
No announcement yet.

Picking up href from within table column

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Picking up href from within table column

    I am currently logging down all of the websites that we deal with in one large table, the table has columns covering IP Number, Domain, Notes and an option to visit the site.

    What I am trying to do is have the last column, called Visit, enable you to click on the link and then go off to that particular site. However, instead of just manually inputting each of the links, I was wondering if I could somehow pickup the address from the Domain column and use this as the link.

    This would save time every time I add a new domain, instead of entering in the domain twice, I would just enter it into the domain column, say putting www.website.com and then in the Visit column, I could pick up this link and put it into the href.

    Hope somebody can help.

    Cheers

    Chris

  • #2
    Thanks for that Dave, it works great. However the column named Domain is not actually a link, it just has the domain written down without a href.

    Is there anyway of picking it up from that?

    Comment


    • #3
      Wrap the domain column with a div and id.

      <DIV ID="domain1">domain url</DIV>

      then use innerHTML to get the domain url. I don't think NS4 supports innerHTML though.

      Comment


      • #4
        Thanks tamienne but I'm not really sure how to do that, I'm only bothered about IE.

        Thanks

        Chris.

        Comment


        • #5
          Thanks Dave, but all I'm getting is a syntax error, maybe it would be easier if I showed you exactly what I'm doing:

          Comment


          • #6
            I suggest a different approach:

            Construct the whole table dynamically from a data array - not only will you save time adding new domain names, you will also save time by not having to "<TR><TD>" and such.

            Check my version of the code that does dynamic tables construction and manipulation at:
            Vladdy's Tables

            PM or E-mail me if you would like to adapt my code to your project.
            Vladdy | KL
            "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

            Comment

            Working...
            X