I encountered a problem with the code below:
$('#refresh').click(function () {
alert($('.report-container').length);
$('.report-container').each(function () {
var accordian = this;
var url = $(this).children(':first-child').val();
$('form').ajaxSubmit({
url: url,
success: function (responseText, statusText, xhr, $form) {
$(accordian).html(responseText);
}
});
});
});
This code is designed to refresh each of the tabular reports on the page using the user-configured form.
My expectation was that it would replace the one and only '.report-container' element with the fragment downloaded from the server. However, every time this runs, the call to
alert($('.report-container').length);
increments?
This issue has been causing various problems - I'm not sure what I am missing here.
In addition to this, I have attempted to use the target property on the ajaxForm plugin with the same outcome.
I can confirm that the server responds with only one '.report-container' in the fragment, so it should be a one-to-one replacement.