0

This function only runs once. How can I get it to run multiple times?

I have tried using live() as was suggested in another SO question, but that made no difference to the program.

$(function() {
  $('#chooseTeam').live('change', (function() {
      $.getJSON($SCRIPT_ROOT + '/_get_info', {
            selectedDeck: $('#chooseTeam').val()
          }, function(data) {
                 /* Do something */
          });
      }
    return false;
 }));
});
4

1 回答 1

-1

您是否尝试过准备好文档而不是 $function()

$(document).ready(function() {
  $('#chooseTeam').live('change', (function() {
      $.getJSON($SCRIPT_ROOT + '/_get_info', {
            selectedDeck: $('#chooseTeam').val()
          }, function(data) {
                 /* Do something */
          });
      }
    return false;
 }));
});

问候

于 2013-02-25T07:15:45.053 回答