I have an ajax call that is loading a page that inserts some data to the database and then the page returns that data as xml. The ajax call is being run and I can see the page being loaded and the xml being sent back via firebug, but the success function is not being called. If anyone could point me in the right direction it would be greatly appreciated. I have been using ajax in this way for a while and this is the first time I have received this issue.
var bookId = $('#chapter_book_id').val(); var unitId = $('#chapter_unit_id').val(); var chapterTitle = $('#chapter_title').val(); var chapterNumber = $('#chapter_number').val(); var chapterLabel = $('#chapter_label').val(); var chapterSortOrder = $('#chapter_sort_order').val(); var unitLiId = $('#unit_li_id').val();
var url = '/csp/process-add-chapter.php'; var data = { bookId: bookId,unitId: unitId,chapterNumber:chapterNumber,chapterLabel:chapterLabel,chapterSortOrder:chapterSortOrder,chapterTitle:chapterTitle,unitLiId:unitLiId}; var success = function(data){build_chapters(data);};
I have multiple other functions with primarily the same code that just insert into other tables, that are working fine, this one just won't fire the build_chapters function. (note: i added a carriage return to the xml response so it would show up in this post, it was getting cut off...)
There are no javascript errors in firebug.
here is the build_chapters function as it is for the moment
function build_chapters(xmldata) { $(xmldata).find('result').each( function() { var id = $(this).attr('new_id'); alert(id); }); }