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

  • SEARCH
  • Home
  • 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 7592725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:58:50+00:00 2026-05-30T20:58:50+00:00

i have a strange problem, i’m binding an action to a button using the

  • 0

i have a strange problem, i’m binding an action to a button using the jQuery function (click), when i click the button nothing happens, how that come!, here’s the code i’m using: `

<script >
    $( '#admin' ).live( 'pageinit',function(event){
    $('#AddButton').click(function(){
            alert("Clicked")
        });​
    });
</script>
  • 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-30T20:58:51+00:00Added an answer on May 30, 2026 at 8:58 pm

    Assuming the button exists in the initial page source you need to either:

    1. Put your <script> block somewhere in the source after the button, or
    2. Wrap the above code in a $(document).ready() handler.

    Otherwise the button’s html will not have been parsed by the browser when the JS runs so the button won’t be found.

    If the button does not exist initially, i.e., you are adding it dynamically in response to some other event, then you can use:

    $('#AddButton').live('click', function(){ ...
    

    …similar to what you’re already doing for your admin element and the handler will automatically apply to the button once it does exist.

    Note though that .live() is deprecated from jQuery version 1.7 onwards so if using 1.7 you should use the .on() method instead, and even in older jQuery the .delegate() method is preferred. The API doco for .live() explains how to convert.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a strange problem when deleteting records using linq, my suspicion is that
I have a strange problem. I have a jQuery document.ready function executing some script
I have strange problem with the delay function here using the HTML function with
I have a strange problem with mod_rewrite, the rules that are relevant here are:
I have a strange problem with lxml when using the deployed version of my
I have a strange problem that is only happening in a single location. I
I have a strange problem that I could not solve. When I try to
I have a strange problem in Visual Studio 2010 (C#) using the Report Viewer
I have a strange problem when using Entity Framework code first. When I return
I have a strange problem: I have a CSV file that I read correctly

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.