Create a new anchor tag and set its innerHTML

Discussion in 'HTML' started by jbonifacejr, Feb 4, 2008.

  1. jbonifacejr

    jbonifacejr Guest

    I would like to be able to create HTML anchor tags, set their
    innerHTML values, and be able to click on them later in a process. For
    example, I want to set the innerHTML values for three links. When the
    first page loads, I want to click the first link, Link1, then wait for
    page 2 to load, click Link2, etc.

    I am using the mshtml and have the following lines...
    mshtml.HTMLAnchorElement lnkYourAcctOrders;
    mshtml.HTMLAnchorElementClass lnkYourAcctShipAddy;
    mshtml.HTMLAnchorElementClass lnkYourAcctPmtInfo;

    When I try to set the values I get an error telling me the objects
    have not been instantiated, so I added the following lines before
    trying to set the innerHTML...
    lnkYourAcctOrders = new mshtml.HTMLAnchorElement();
    lnkYourAcctShipAddy = new mshtml.HTMLAnchorElementClass();
    lnkYourAcctPmtInfo = new mshtml.HTMLAnchorElementClass();

    I realize that I have two different things above, the
    mshtml.HTMLAnchorElement and the mshtml.HTMLAnchorElementClass. I have
    this because I was trying to make either one work. I couldn't.

    I know that I could load the page, and then put all the links in a
    collection, and then click on the one that has an innerHTML matching
    what I want. I was hoping to avoid that and simply be able to click on
    the link I build, if it exists on the page.

    Does anyone know how I would go about this?

    Thanks in advance for your help.
    jbonifacejr, Feb 4, 2008
    #1
    1. Advertising

  2. jbonifacejr

    Neredbojias Guest

    Well bust mah britches and call me cheeky, on Mon, 04 Feb 2008 19:18:54
    GMT jbonifacejr scribed:

    > I would like to be able to create HTML anchor tags, set their
    > innerHTML values, and be able to click on them later in a process. For
    > example, I want to set the innerHTML values for three links. When the
    > first page loads, I want to click the first link, Link1, then wait for
    > page 2 to load, click Link2, etc.
    >
    > I am using the mshtml and have the following lines...


    What's "mshtml"?

    > mshtml.HTMLAnchorElement lnkYourAcctOrders;
    > mshtml.HTMLAnchorElementClass lnkYourAcctShipAddy;
    > mshtml.HTMLAnchorElementClass lnkYourAcctPmtInfo;
    >
    > When I try to set the values I get an error telling me the objects
    > have not been instantiated, so I added the following lines before
    > trying to set the innerHTML...
    > lnkYourAcctOrders = new mshtml.HTMLAnchorElement();
    > lnkYourAcctShipAddy = new mshtml.HTMLAnchorElementClass();
    > lnkYourAcctPmtInfo = new mshtml.HTMLAnchorElementClass();
    >
    > I realize that I have two different things above, the
    > mshtml.HTMLAnchorElement and the mshtml.HTMLAnchorElementClass. I have
    > this because I was trying to make either one work. I couldn't.
    >
    > I know that I could load the page, and then put all the links in a
    > collection, and then click on the one that has an innerHTML matching
    > what I want. I was hoping to avoid that and simply be able to click on
    > the link I build, if it exists on the page.
    >
    > Does anyone know how I would go about this?


    I don't even know what you're trying to do. The first-paragraph
    explanation makes it sound most like you want normal html links to
    sequential pages.

    --
    Neredbojias
    Riches are their own reward.
    Neredbojias, Feb 4, 2008
    #2
    1. Advertising

  3. jbonifacejr

    Baho Utot Guest

    Baho Utot, Feb 4, 2008
    #3
  4. jbonifacejr

    Bergamot Guest

    jbonifacejr wrote:
    >
    > I am using the mshtml and have the following lines...


    Why don't you ask Microsoft how to use their stuff?
    microsoft.public.[some newsgroup related to mshtml]

    --
    Berg
    Bergamot, Feb 5, 2008
    #4
  5. jbonifacejr

    Neredbojias Guest

    Well bust mah britches and call me cheeky, on Mon, 04 Feb 2008 23:11:56 GMT
    Baho Utot scribed:

    > Neredbojias wrote:
    >
    > [putolin]
    >
    >>>
    >>> I am using the mshtml and have the following lines...

    >>
    >> What's "mshtml"?

    >
    > http://en.wikipedia.org/wiki/Trident_(layout_engine)


    I figured it was some MS stuff. Is there any real value to it over, say,
    server-side scripting?

    --
    Neredbojias
    Riches are their own reward.
    Neredbojias, Feb 5, 2008
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. shruds
    Replies:
    1
    Views:
    739
    John C. Bollinger
    Jan 27, 2006
  2. thunk
    Replies:
    1
    Views:
    292
    thunk
    Mar 30, 2010
  3. thunk
    Replies:
    0
    Views:
    452
    thunk
    Apr 1, 2010
  4. thunk
    Replies:
    14
    Views:
    597
    thunk
    Apr 3, 2010
  5. eivind

    div tag and anchor tag

    eivind, Jan 5, 2004, in forum: Javascript
    Replies:
    1
    Views:
    121
    eivind
    Jan 15, 2004
Loading...

Share This Page