Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7190299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:29:04+00:00 2026-05-28T19:29:04+00:00

Okay, I have setup up a handler for a div click but for some

  • 0

Okay, I have setup up a handler for a div click but for some reason it fires on document.ready, and I can’t really figure out why. Here is my code:

function statusCallback(status){
    //THIS IS THE JSONP CALLBACK RECEIVED FROM THE SERVER
    if(status.title==null){
        $('#core').attr('class','play');
        $('#button').animate({marginLeft:'350px'},2000,'easeOutCubic',function(){
            $('#button').click(initialBinder());
        });
    }else{

    }
}
function initialBinder(){
    $('#button').unbind('click');
    $('#core').attr('class','load');
    $('#button').animate({marginLeft:'0px'},2000,'easeOutCubic',function(){
        $.ajax({
            url:'http://24.182.211.76/status.php',
            crossDomain:true,
            dataType:'jsonp'
        });
    });
}
$(document).ready(function(event){
    $('#button').click(initialBinder());
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T19:29:05+00:00Added an answer on May 28, 2026 at 7:29 pm

    Change:

    $('#button').click(initialBinder());
    

    to:

    $('#button').click(initialBinder);
    

    The former will actually call the function, not return a function pointer to it.

    Perhaps this little bit of code can clarify the difference:

    function foo(x, y) //I'm function foo, I add two numbers like a boss
    {
       return x + y;
    };
    
    var x = foo(1,1); //x is 2 because we called the function
    var y = foo; //y is a reference to function foo, no parentheses
    var z = y(1,1); //z is 2 because we called foo through reference y
    document.write('x = ' + x + '<br />z = ' + z);
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, I need some solid OOP advice. Here's the setup: I have a player
Okay, I have a database, but no tables in it. I have some entity
Okay, I know I'm doing something wrong - but can't figure out a better
Okay I have updated my code a little, but I am still not exactly
Okay i have two models: posts and comments. as you can think comments has
Okay I'm having a problem. I have a social networking site and have some
Okay so I've setup an app which works fine but there's one problem when
Okay I have this RewriteRule which is supposed to redirect any request for the
Okay I have a large CRUD app that uses tabs with Forms embedded in
Okay I have a series of objects based on a base class which are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.