Is there a code to auto click a part of a webpage?

by 19 replies
27
Is there a code to auto click a part of a webpage? When someone goes to my page,there is a link on a part of the page that gets clicked. Is this possible?
#programming #auto #click #code #part #webpage
  • I don't have any idea about that
    but it's interesting to me , I also want to know this one.
    hope someone will help us to know it.
  • I'm not real sure what you are looking for? but you can pretty much have anything happen through a number of methods, which will achieve the result you desire. depending on the the context of the result, this will dictate the environment your working in, and the interface used to create the event or task. With all this as it is, there is also more than one way to skin a cat. If you can think it up, it can be created in the virtual world of love.

    hope this helps?

    >>"<<
  • Assuming I have this right and you are basically looking for a way to redirect the customer automatically to a different web page you could use a meta redirect by placing the following code in the head section of the page as below..

    <meta http-equiv="refresh" content="0;url=http://thedomain.com/the-new-page.html" />

    You will need to change this section to your actual new link "http://thedomain.com/the-new-page.html"

    Normally used if you move a page from one location to another it should work for this as well.
    • [ 1 ] Thanks
    • [1] reply

    • Thanks for the response. I'm not looking for the meta redirect. I am looking for a redirect though. Maybe I'm explaining wrong.

      I'll try. Lets say someone clicked on my page example.com/aproduct.php .Is there a way to have a link on that page clicked automatically?
      • [2] replies
  • Hey, vjboc, It's a very general question and you're bound to get generic answers. For some reason I enjoyed reading your answer, scttstrng! It's well-worded, covers a lot of ground and, either, tells the original poster all he needs to know or leaves him more confused.

    Virtual world of love, indeed. "hope this helps" - that's a classic!
    • [ 1 ] Thanks
  • Hi, vjboc
    There's a stackoverflow question that, I think, deals with what you're looking for. Please have a look at the "fireEvent" function in the top answer.
    Is it possible to trigger a link's (or any element's) click event through JavaScript? - Stack Overflow

    You'll probably need a bit of javascript knowledge to be able to incorporate it into your code.
    • [ 1 ] Thanks
  • vjboc... you can force to click almost every object on web site with jQuery.
    • [1] reply
    • Thanks Dansky, Can you show me the jQuery code I would need to do this?
  • Clickjacking - Wikipedia, the free encyclopedia

    Note that what you're asking about, if done without consent, is a federal computer crime (that it's technically easy doesn't make it legal), and has been prosecuted.

    Ascend Media is in court with Facebook over clickjacking right now.

    A group of 7 people that used clickjacking to send people trying to click links to iTunes to a malicious website are being prosecuted by the US government right now. The charges include 7 felony crimes with a recommended sentence of 30 years.
    • [1] reply
    • Dan thanks for your concern and heads up about this, but If I wanted to send people to a malicious website, I could do that with a meta refresh right? Anyways, what I would be using this code for is my own site and also to expand my learning about different codes and how they work.
  • Hey, Dan! It's always very helpful to point out potential "failure paths" in any task just like you've done.

    I personally find your comment very informative and appropriate. I think, most things can be used for, both, good and bad. A bit like superhero powers. Or Cannabis. (joke)

    Having read what you wrote I, personally, would still give the OP the benefit of the doubt.

    Sometimes you need to understand how an exploit works, be it web security, fraud, etc. We show only how to split the atom (humbly) not how to build the you know what.

    Of course, the OP might have a completely different application for it. One we may not be aware of.

    Just of the top of my head, say I'm doing some browser application that generates a click map to test user engagement and I can load other websites (quite possibly my own sites) within this page through an iFrame. Say, I want to automatically click "not interested" on the email subscription pop up you get these days on so many sites. Is that legal? I have no idea. (If it isn't this is a fictional example, any resemblance to real actions is purely accidental)

    It's a contrived, impractical example but, who knows, people do all sorts of things for all sorts of reasons.

    Nothing but love to you
  • Banned
    [DELETED]
  • Banned
    [DELETED]
  • You can do like this with jQuery:

    <a href="#warning" id="warningta"></a>

    jQuery("a#warningta").trigger('click');
    • [ 1 ] Thanks
    • [1] reply
    • Are you talking when the page loads? You can just use window.onload to click your button when the page loads.

      Code:
          <script type="text/javascript">          
                   function invokeMe() { 
                         
                         var chkPostBack = 'true';             
                         
                         if (chkPostBack == 'false') {                 
                              
                             document.getElementById("submitBtn").click();
                         }
                   }          
                    
                   window.onload = function () { invokeMe(); };      
      </script>
      • [ 1 ] Thanks
      • [1] reply
  • nice answers, but is it an automated service or plugin (for WordPress or etc.) which can do this without coding?
  • Have you tried iMacros? this can do what you want it too.

Next Topics on Trending Feed