프로젝트에 MVC 4를 사용 중이며 팝업에서 데이터를 편집하거나 표시하려고합니다.지속적인 호출 후 JQuery 팝업이 작동하지 않습니다.
열려있는 팝업 코드를 6 번 또는 7 번 호출하면 자바 스크립트 오류가 발생합니다.
내 컨트롤러는
public ActionResult OpenEditForm(string objectParam, string formStatus)
{
BranchNotesDetailViewModel viewModel = new BranchNotesDetailViewModel();
//..................
return PartialView("Edit", viewModel);
}
과 내가 대화 상자 하나가 작동을 두 번 열 때 내 자바 스크립트 코드는
myDialog = $("<div> </div>");
function CreateDialog(name) {
myDialog.dialog({
autoOpen: false,
title: name,
resizable: false,
position: 'center',
stack: true,
height: 'auto',
width: 'auto',
modal: true,
close: function (event, ui) {
// remove div with all data and events
myDialog.remove();
//myDialog.dialog('close')
}
});
}
$('#brancNotesList .grid-row').click(function() {
var json = $(this).children('td:eq(1)').text().trim();
$.ajax({
contentType: 'application/html',
url: '@Url.Action("OpenEditForm", "BranchNotes")',
dataType: 'html',
type: 'GET',
data: {
objectParam: json,
formStatus: "1"
}
}).done(function (result) {
CreateDialog('Detail');
myDialog.html(result).dialog('open');
});
});
$(function() {
$(document).ajaxComplete(function (event, request, settings) {
//re-parse the DOM after Ajax to enable client validation for any new form fields that have it enabled
$.validator.unobtrusive.parse(document);
});
});
function openFormCreate() {
$.ajax({
contentType: 'application/html',
url: '@Url.Action("OpenEditForm", "BranchNotes")',
dataType: 'html',
type: 'GET',
data: {
formStatus: '2'
}
}).done(function (result) {
CreateDialog('Detail');
myDialog.html(result).dialog().dialog('open');
});
}
하지만 5,6 시간 후에는 예외 자바 스크립트 런타임 오류와 충돌 : 오류로 인해 작업을 완료 할 수 없습니다. 80020101
아약스 호출 후 메모리 문제 등을 찾으려고했지만 캔트 어디서 무엇을 찾을 수 있습니다. 그걸 처리 할 방법이 있습니까? 나는 그 문제에 대해 읽고 논평 필드가 말하는 몇몇 포럼을 읽었지만 그것은 나를 위해 일하지 않는다.