Код: Выделить всё
$('#album_item' + currentCell).on('blur', '#caption_input' + currentCell, function(e) {
e.stopPropagation();
// we extract the num in the id to use related elements
var numberPattern = /\d+/g;
var id = $(this).attr("id");
id = id.match(numberPattern);
// save caption, when done reInitFlip
$.ajax({
type: "POST",
url: "insert_caption",
data: {
thumbnail: file.thumbnail_url,
caption: $('#caption_input' + currentCell).val()
}
}).done(reInitFlip(data, id));
});
Код: Выделить всё
var reInitFlip = function(data,id) {
};
значение идентификатора элемента, вызвавшего это событие, так как их может быть несколько.
Как я могу отправить эти данные в метод? или альтернативно, как я могу узнать, какой элемент вызвал вызов ajax внутри reInitFlip?
Подробнее здесь: https://stackoverflow.com/questions/130 ... one-method