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

by vjboc
19 replies
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?
#auto #click #code #part #webpage
  • Profile picture of the author kazim
    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.
    {{ DiscussionBoard.errors[7091874].message }}
  • Profile picture of the author scttstrng
    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?

    >>"<<
    {{ DiscussionBoard.errors[7092021].message }}
  • Profile picture of the author webpeon
    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.
    Signature
    Web 2 Mobile
    The Future of The Web
    {{ DiscussionBoard.errors[7092154].message }}
    • Profile picture of the author vjboc
      Originally Posted by webpeon View Post

      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.

      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?
      {{ DiscussionBoard.errors[7092559].message }}
      • Profile picture of the author webpeon
        Originally Posted by vjboc View Post

        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?
        What part of the process does the visitor get to see? It gets a bit hazy around about steps 3, 4 and 6 for me if you can answer those questions.

        1. customer visits aproduct.php
        2. page loads
        3. does the customer see the page and link?
        4. does the customer see the link being clicked, like an animated cursor of sorts
        5. link is automatically clicked
        6. what does the link do? does it send the visitor to a new page?
        Signature
        Web 2 Mobile
        The Future of The Web
        {{ DiscussionBoard.errors[7092780].message }}
      • Profile picture of the author new2im
        Originally Posted by vjboc View Post

        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?
        use the javascript onload event just attach it to the desired link
        {{ DiscussionBoard.errors[7115868].message }}
  • Profile picture of the author chretit
    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!
    {{ DiscussionBoard.errors[7092291].message }}
  • Profile picture of the author chretit
    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.
    {{ DiscussionBoard.errors[7092699].message }}
  • Profile picture of the author Dansky
    vjboc... you can force to click almost every object on web site with jQuery.
    {{ DiscussionBoard.errors[7093063].message }}
    • Profile picture of the author vjboc
      Originally Posted by Dansky View Post

      vjboc... you can force to click almost every object on web site with jQuery.
      Thanks Dansky, Can you show me the jQuery code I would need to do this?
      {{ DiscussionBoard.errors[7094278].message }}
  • Profile picture of the author Dan Grossman
    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.
    Signature
    Improvely: Built to track, test and optimize your marketing.

    {{ DiscussionBoard.errors[7094347].message }}
    • Profile picture of the author vjboc
      Originally Posted by Dan Grossman View Post

      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.
      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.
      {{ DiscussionBoard.errors[7096511].message }}
  • Profile picture of the author chretit
    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
    {{ DiscussionBoard.errors[7095694].message }}
  • Profile picture of the author mediabay
    You can do like this with jQuery:

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

    jQuery("a#warningta").trigger('click');
    {{ DiscussionBoard.errors[7118196].message }}
    • Profile picture of the author sean3838
      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>
      {{ DiscussionBoard.errors[7123040].message }}
      • Profile picture of the author vjboc
        Originally Posted by sean3838 View Post

        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>

        Thanks Sean, What do I change on this code to make it work on my page? submitBtn? What if there are more than one submit button on the page? Also does this work with asp?
        {{ DiscussionBoard.errors[7134211].message }}
        • Profile picture of the author sean3838
          Originally Posted by vjboc View Post

          Thanks Sean, What do I change on this code to make it work on my page? submitBtn? What if there are more than one submit button on the page? Also does this work with asp?
          Yes you can get it to work with asp but if its a server rendered control then it will be a little different. You'll have to use ClientID. Just substitute submitBtn with the ID of your button. And yes you can click more than 1 button.

          Code:
              <script type="text/javascript">
          
                  function invokeMe() {
          
                      var chkPostBack = '<%= Page.IsPostBack ? "true" : "false" %>';
          
                      if (chkPostBack == 'false') {
          
                          document.getElementById("<%=submitBtn.ClientID%>").click();
                          document.getElementById("<%=otherBtn.ClientID%>").click();
                      
                      }
                  }
          
                  window.onload = function () { invokeMe(); };
          
              </script>
          {{ DiscussionBoard.errors[7138305].message }}
  • Profile picture of the author tarfandkhaneh
    nice answers, but is it an automated service or plugin (for WordPress or etc.) which can do this without coding?
    Signature

    my e-book:
    http://veganidealworld.com/ebook-veg...-better-world/

    All affiliators are welcome!

    {{ DiscussionBoard.errors[7123535].message }}
  • Profile picture of the author wlasikiewicz
    Originally Posted by vjboc View Post

    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?
    Have you tried iMacros? this can do what you want it too.
    {{ DiscussionBoard.errors[7123544].message }}

Trending Topics