servlet called

servlet called

I would appreciate someone's expertise to solve my dilemma. I have a website which uses AJAX, jQuery and MySql DB. The code populates a table upon Document.ready call (MVC used: jsp calls Servlet with ($.get controller_1() ) and servlet calls class file (queries DB), then servlet response back to main jsp page. This code dynamically creates a button/( ie to look like a hyperlink). When the button is clicked jQuery used $.get controller_2 ( a different servlet). Unfortunately, the click function sends to controller_1 instead of controller_2 ( correct servlet ). I assume this is because the document ready is overriding the button click function. I there a way to correct this? Session problem?

PARTS OF CODE BELOW:


$(function() {// DOM Ready jQuery $.get('controller_1',// servlet name for table function(jsonResponse) { }); function btn0() { $("button").click(function() { $.get('controller_2', // servlet name for button click { Select1 :linkCount[0] },// parameters passed here (ie from button) function(jsonResponse) {} ); // end of get function }); } }