此代码位于我的一个JS文件gatewayList.js
中。在这个文件中,我有以下功能:
function loadDetailsForEdit(data){
editGatewayDialog = BootstrapDialog.show({
title: 'Edit Gateway',
cssClass: 'modified-dialog',
closeByBackdrop: false,
closeByKeyboard: false,
onshow: function(dialog) {
populateDetailsForEditForm(data);
},
message: $('<div></div>').load(EDIT_FORM),
});
}
上述功能调用populateDetailsForEditForm(data)
此函数在另一个JS文件中定义,其名称为editGateway.js
function populateDetailsForEditForm(gateway) {
$('#editForm').show();
$('#remarks').val(gateway.remarks);
}
但服务器无法从editGateway.js
文件中找到此gatewayList.js
文件。它在Chrome浏览器中出现以下错误:
未捕获的ReferenceError:未定义populateDetailsForEditForm
list.html
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 dataGridTitle">
Recent Gateway List
</div>
<div class="col-xs-12" style="border: 1px solid #ADADAD; padding-top:10px">
<table id="gatewayGrid" class="table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th>Gateway Id</th>
<th>Gateway Name</th>
<th>Issuing Country</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
<script src="/administration/gateway/controller/editGateway.js"></script>
<script src="/administration/gateway/controller/gatewayList.js"></script>