使用Jquery ajax和servlet / jsp。我在stackoverflow中搜索这个问题,我发现一些线程但没有解决我的问题。我有自助表格。使用外部js文件。我的servlet响应是Json对象。错误看起来像无限循环。这是我的错误:
Uncaught RangeError: Maximum call stack size exceeded
at Ab (jquery-3.2.1.min.js:4)
at Ab (jquery-3.2.1.min.js:4)
at Ab (jquery-3.2.1.min.js:4)
我的表格:
<form action="AddBand" method="POST" id="addBand">
<div class="form-group">
<label for="bandName">GRUP ADI</label>
<input type="text" id="bandName" class="form-control" name="bandName">
</div>
<div class="form-group">
<div class="row">
<div class="col-md-4">
<label for="member">GRUP ÜYESİ</label>
<input type="text" id="member" class="form-control" name="member">
<input type="button" class="btn btn-success" style="float: right;" onClick="addMember();" value="Ekle">
</div>
<div class="col-md-8">
<label for="bandName">EKLENEN ÜYELER</label>
<select class="form-control" name="memberList" id="memberList"></select>
<input type="button" class="btn btn-success" style="float: right;" onClick="deleteMember();" value="Çıkar">
</div>
</div>
</div>
<div class="from-group">
<label for="bandPicture">GRUP RESMİ</label>
<input type="file" accept="image/x-png,image/gif,image/jpeg" id="bandPicture" onchange="uploadImage(this)" class="form-control" name="bandPicture">
<label id="uploadResult"></label>
<input type="hidden" id="fileName" name="fileName" />
</div>
<div class="form-group">
<label >
<input type="checkbox" name="standartBand">Haftalık Grup
</label>
</div>
<div class="form-group">
<label for="bandInfo">GRUP HAKKINDA</label><br>
<textarea class="form-control" id="editor" rows="6" name="bandInfo"></textarea>
</div>
<div class="form-group">
<button type="button" onClick="saveEntity(this.form)" class="btn-success">Grubu Ekle</button>
<label id="formResult"></label>
</div>
function saveEntity(entityForm) {
$.ajax({
type: $(entityForm).attr('method'),
url: $(entityForm).attr('action'),
datatype : 'json',
data: entityForm,
success: function (result) {
var data = $.parseJSON(result);
$('#formResult').html(data.resultMsg)
}
});}