Results 1 to 6 of 6

Thread: [resolved] InvokeMember("click") Javascript event (2fast for website) Help Fixit? :-)

Threaded View

  1. #1

    Thread Starter
    Addicted Member jalexander's Avatar
    Join Date
    Jan 2011
    Location
    Memphis, TN
    Posts
    160

    Red face [resolved] InvokeMember("click") Javascript event (2fast for website) Help Fixit? :-)

    Code:
           For Each h As HtmlElement In WebBrowser1.Document.GetElementsByTagName("a")     ' * sends suprise teddy bear to a random forum member every 15
                If h.OuterHtml.ToLower.Contains("Give_ForumUser_TedBear") Then
                    h.InvokeMember("click")
                End If
            Next
    Edit: I put the code at the top, so I could save everybody time from reading my entire post if they don't recognize the code type!

    Hey guys another fresh newbie question!
    Some of you may know I run my own little web forum for a non-profit organization thingy. And that I'm making a program to automate some of my every day tasks as the administrator of it.
    I recently added the ability to send 'gifts' (like smiley faces & teddy bears) to members as like a nice thing to make people smile.

    Anyway when I'm reviewing new forum users profiles, I have a timer set to "click on send a teddy bear" on whomever's page I happen to b on at a 15 min interval.
    The text on the actual link (before sending) says "Send Teddy Bear" & after clicking it will say "Unsend Teddy Bear" in case you sent it on mistake.
    Problem (besides being a dummy newb) is when this code sends a click to this javascript event/link - the webpage is slow or something to receive the click I think. It always gets sent (from vb), sometimes its just slow for the link to change from "Send Teddy Bear" To "Unsend Teddy Bear" on the webpage. And it almost seems as if it clicks it more than once sometimes, which means it SENDS & THEN UNSEND'S the teddy bear! How can I make sure it only sends the click 1 time?
    So my forum users will have their teddy bear & lots of my forum members will be happy with me. Because aren't we all just seeking approval & love in this crazy upsidedown world!

    So any ideas vbforum guys? On how I can make sure it only sends the click once, no matter if the javascript link text is still the 'same' (because it hasn't changed yet, due to server bring slow)
    Thanks for taking the time to read my thread. I really appreciate all the helpful people here, you guys are a blessing!
    Last edited by jalexander; Oct 31st, 2012 at 07:34 PM. Reason: resolved
    dim jenn as geek = true
    Learning ~ Visual Basic 2010 ~ in free time between college/work -
    currently looking for a 'programming buddy' / 'coder friend' / and or 'mentor'. p.m. me if you
    have ANY free time AT ALL I'm like 33% of a novice level ~ willing 2 listen/learn +
    i am totally super motivated & promise to make an effffin amazing protege!!! #swag

    | -_-_- -_-_- |
    ...W.T..F!?.....
    ||| Matter on the atomic/quantum level isn't solid or even matter at all. It can also exist in at least 2 places simultaneously (demonstrated in lab). It's position can only be established when it's actually observed. If we turn our back on it... it goes back to a wave form. History show's that every previous generation (since the beginning of time) got almost everything wrong. Then it might very well stand to reason that up is down & right can be wrong. Admit it.. our combined perception of reality is just that, we know absolutely nothing of actual reality & to think we do is simply subscribing to a "ignorance is bliss" mantra |||

Tags for this Thread

Posting Permissions

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



Click Here to Expand Forum to Full Width