javascript - Jquery message only on first row -
javascript - Jquery message only on first row -
i'm having problem: when clicking on edit buttom, message of successful/error alert displayed on first row if click on second. js
var route = new function () { var oglobal = this; this.ssaveurl = ''; this.setsaveurl = function (_surl) { this.ssaveurl = _surl; } this.seteventsubmit = function () { $('[id^="route_update"]').each(function () { $(this).click(function () { var odata = $(this).closest('tr').find('input').serializearray(); var orow = $(this).closest('tr'); console.log(odata); oreq = $.post(oglobal.ssaveurl, odata, function (data) { if (data['valid'] != "true") { //console.log('error'); //fade in orow.closest('#comment').html('error').css('display', 'block').fadein(1000); //fade out settimeout(function () { $('#comment').html('').fadeout(1000); }, 1500); //fade in $('#comment') } else { //console.log('success'); //fade in $('#comment').html('insert success').fadein(1000); //fade out settimeout(function () { $('#comment').html('').fadeout(1000); }, 1500); //fade in $('#comment') } homecoming false; }, 'json'); homecoming false; }); }); } this.init = function () { this.seteventsubmit(); } }
what wrong?
thanks in advance
javascript jquery ajax
Comments
Post a Comment