当ajax调用时,Jquery日期给出错误

时间:2015-01-26 05:43:05

标签: jquery ajax

Jquery在托管应用程序后给出错误,但在VS2013中调试时工作正常。如果选择10或以上,则错误是日期,但如果日期低于10,则工作正常。

$('#btnSaveInternalMeeting').bind('click', function () {

            if ($('#IMeetingDate').val() == "") {
                alert('Please select date.');
                return false;
            }

            var InternalCaller = "", InternalMeetingAttendees = "";
            $('.removeInternalCaller').each(function (i, obj) {
                InternalCaller += $(this).attr('tag') + ",";
            });

            if (InternalCaller.length < 2) {
                alert('Please select atlest one attendees...');
                return false;
            }

            $('.removeInternalAttendees').each(function (i, obj) {
                InternalMeetingAttendees += $(this).attr('tag') + ",";
            });

            if (InternalMeetingAttendees.length < 2) {
                alert('Please select atlest one attendees...');
                return false;
            }
            if ($('#btnSaveInternalMeeting').val() == 'Save') {
                $.ajax({
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    url: "MeetingArrangements.aspx/SaveInternalData",
                    data: "{'MeetingOn':'" + $('#IMeetingDate').val() + "' ,'MeetingStatus':'" + $('#ddlIMeetingStatus option:selected').text() + "' ,'CallersVRTeam':'" + InternalCaller + "' ,'AttendeesVRTeam':'" + InternalMeetingAttendees + "'}",
                    context: document.body,
                    success: function (responseText) {
                        var data = $.parseJSON(responseText.d);
                        alert('Save successfully!');
                        $('#btnSaveInternalMeeting').attr('tag', responseText.d);
                        $('#btnSaveInternalMeeting').val('Update');
                        $('#InternalMeetingAgendaTaskTable').show();
                        $('#Mail').show();
                    }
                });
            }
            else {
                $.ajax({
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    url: "MeetingArrangements.aspx/UpdateInternalData",
                    data: "{'MeetingOn':'" + $('#IMeetingDate').val() + "' ,'MeetingStatus':'" + $('#ddlIMeetingStatus option:selected').text() + "' ,'CallersVRTeam':'" + InternalCaller + "' ,'AttendeesVRTeam':'" + InternalMeetingAttendees + "' ,'IMeetingId':'" + $('#btnSaveInternalMeeting').attr('tag') + "'}",
                    context: document.body,
                    success: function (responseText) {
                        var data = $.parseJSON(responseText.d);
                        //$(this).attr('tag', data);
                        alert('Update Successfully!');
                        $('#btnSaveInternalMeeting').attr('tag', responseText.d);
                        $('#InternalMeetingAgendaTaskTable').show();
                        $('#Mail').show();
                    }
                });
            }
        });

0 个答案:

没有答案