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 3680242
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:33:13+00:00 2026-05-19T03:33:13+00:00

thank you for taking time to look at this. I am trying to code

  • 0

thank you for taking time to look at this.

I am trying to code my very first jQuery plugin and have run into my first problem. The plugin is called like this

<div id="kneel"></div>
<script type="text/javascript">
$("#kneel").zod(1, { });
</script>

It takes the first option (integer), and returns html content that is dynamically generated by php. The content that is generated needs to be bound by a variety of functions (such as disabling form buttons and click events that return ajax data.

The plugin looks like this (I have included the whole plugin in case that matters)…

(function( $ ){
  $.fn.zod = function(id, options ) {  

    var settings = {
      'next_button_text': 'Next',
      'submit_button_text': 'Submit'      
    };

        return this.each(function() {        
            if ( options ) { 
              $.extend( settings, options );
        }

        // variables
        var obj = $(this);

      /* these functions contain html elements that are 
      generated by the get() function below */

        // disable some buttons
           $('div.bario').children('.button').attr('disabled', true);

        // once an option is selected, enable the button
           $('input[type="radio"]').live('click', function(e) { 
          $('div.bario').children('.button').attr('disabled', false);
           })
        // when a button is clicked, return some data
           $('.button').bind('click', function(e) { e.preventDefault();
             $.getJSON('/returnSomeData.php, function(data) {
             $('.text').html('<p>Hello: ' + data + '</p>');
           });

    // generate content, this is the content that needs binding...
    $.get('http://example.com/script.php?id='+id, function(data) {
      $(obj).html(data);
    });

  });

  };
})( jQuery );

The problem I am having is that the functions created to run on generated content are not binding to the generated content. How do I bind the content created by the get() function?

  • 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-19T03:33:14+00:00Added an answer on May 19, 2026 at 3:33 am

    You may find the .delegate or .live to be useful. They are able to bind events to current and future elements in the document, instead of only documents found at the time of the call.

    EDIT

    Here is a working example of what I mean: http://www.jsfiddle.net/bradchristie/39Gt5/ Note that I don’t make any further calls to the delegate function, but it is adding new paragraphs and buttons as you click the button, and the click event is automatically bound.

    UPDATE

    For those of you finding this post and using jquery 1.8+, .delegate/.live have been deprecated and replaced by .on. The linked reference shows exmaple of how to convert your code to use the new .on() method as well.

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

Sidebar

Related Questions

Thank you for taking the time to read this and I will appreciate every
Thank you for taking the time to read this and I will appreciate every
Thank you for taking the time to read this and I will appreciate every
Thank you for taking the time to read this and I will appreciate every
I now have it set up so that when people go to a thank
Thanks for reading. I'm a bit new to jQuery, and am trying to make
I was trying to get this with divs and css, but I was advice
In trying to determine what area of a large query i have is causing
I have been tasked with taking an Access 97 application and moving the back-end
What is the SQL query to select all of the MSSQL Server's logins? Thank

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.