所以我在我的 JS 中有这个意外的输入结束,它在第 1 行,我真的不明白它是什么,这是代码:
window.HandlePageCommand = function (commandName) {
document.getElementById("buffer").innerHTML = commandName + " | " + window.ActiveForm.Name;
var activeForm = window.ActiveForm;
var call;
var callback;
var requestData;
var grid;
if (commandName === "CANCEL") {
Exertus.MainModalPanel.Hide();
return;
}
if (commandName === "ADD_PERIOD") {
target = activeForm.Sections[1];
window.SelectedState = {};
activeForm.BindUI(window.SelectedState);
grid = window.RegisteredControls.Grids["Semestres"];
grid.AddedEntities = [];
grid.DeletedEntities = [];
grid.Databind([]);
Exertus.MainModalPanel.Show("Detalle", target);
return;
}
if (commandName === "ADD_MATERIAL") {
target = activeForm.Sections[1];
window.SelectedState = {};
activeForm.BindUI(window.SelectedState);
grid = window.RegisteredControls.Grids["GRID_DE_MATERIALES"];
grid.AddedEntities = [];
grid.DeletedEntities = [];
grid.Databind([]);
Exertus.MainModalPanel.Show("DETAIL", target);
return;
}
if (activeForm.Name === "Periodos") {
callback = function (responseData) {
var innerGrid = window.RegisteredControls.Grids["Semestres"];
var responseInfo = jQuery.parseJSON(responseData);
innerGrid.Databind(responseInfo.Users);
window.SetLoading(false);
Exertus.MainModalPanel.ShowText("Notificación", "Se han guardado los cambios.");
}
if (window.ActiveForm.Validate() != true) {
return;
}
window.SetLoading(true);
call = new Exertus.ServerCall("MainWebModule");
this.SelectedPeriod = this.SelectedPeriod || {};
activeForm.BindEntity(this.SelectedPeriod);
grid = window.RegisteredControls.Grids["Semestres"];
requestData = {
PeriodData: this.SelectedPeriod
}
call.Execute("SavePeriodChanges", requestData, callback);
return;
}
if (commandName === "GUARDAR") {
if (activeForm.Name === "Factores de Venta 1") {
var callback = function (responseData) {
window.OriginalFactors = jQuery.extend({}, window.FactorsInfo);
window.SetLoading(false);
Exertus.MainModalPanel.ShowText("Notificación", "Se han guardado los cambios.");
}
if (window.ActiveForm.Validate() != true) {
return;
}
window.SetLoading(true);
var call = new Exertus.ServerCall("MainWebModule");
window.FactorsInfo = window.FactorsInfo || {};
activeForm.BindEntity(window.FactorsInfo);
call.Execute("SaveFactors", window.FactorsInfo, callback);
return;
}
if (commandName === "SAVE") {
if (activeForm.Name === "Direcciones") {
var callback = function (responseData) {
window.OriginalAddress = jQuery.extend({}, window.AddressInfo);
window.SetLoading(false);
Exertus.MainModalPanel.ShowText("Notificación", "Se han guardado los cambios.");
}
if (window.ActiveForm.Validate() != true) {
return;
}
window.SetLoading(true);
var call = new Exertus.ServerCall("MainWebModule");
window.AddressInfo = window.AddressInfo || {};
activeForm.BindEntity(window.AddressInfo);
call.Execute("SaveAddress", window.AddressInfo, callback);
return;
}
if (commandName === "SAVE") {
if (activeForm.Name === "Materiales") {
var callback = function (responseData) {
window.OriginalMaterials = jQuery.extend({}, window.MaterialsInfo);
window.SetLoading(false);
Exertus.MainModalPanel.ShowText("Notificación", "Se han guardado los cambios.");
}
if (window.ActiveForm.Validate() != true) {
return;
}
window.SetLoading(true);
var call = new Exertus.ServerCall("MainWebModule");
window.MaterialsInfo = window.MaterialsInfo || {};
activeForm.BindEntity(window.MaterialsInfo);
call.Execute("SaveMaterials", window.MaterialsInfo, callback);
return;
}
if (commandName === "CANCEL") {
Exertus.MainModalPanel.Hide();
return;
}
if (commandName === "GUARDAR") {
if (activeForm.Name === "Factores de Venta 2") {
var callback = function (responseData) {
window.OriginalFactorsBoundaries = jQuery.extend({}, window.FactorsBoundariesInfo);
window.SetLoading(false);
Exertus.MainModalPanel.ShowText("Notificación", "Se han guardado los cambios.");
}
if (window.ActiveForm.Validate() != true) {
return;
}
window.SetLoading(true);
var call = new Exertus.ServerCall("MainWebModule");
window.FactorsBoundariesInfo = window.FactorsBoundariesInfo || {};
activeForm.BindEntity(window.FactorsBoundariesInfo);
call.Execute("SaveFactors", window.FactorsBoundariesInfo, callback);
return;
}
if (commandName === "CANCEL") {
Exertus.MainModalPanel.Hide();
return;
}
if (commandName === "SAVE_CHANGES") {
var callback = function (responseData) {
var innerGrid = arguments.callee.Grid;
var entities = jQuery.parseJSON(responseData);
window.FamilyProductsTypes = entities;
innerGrid.AddedEntities = [];
innerGrid.ModifiedEntities = {};
innerGrid.DeletedEntities = [];
innerGrid.Databind(entities);
window.SetLoading(false);
Exertus.MainModalPanel.ShowText("Notificación", "Se han guardado los cambios.");
}
var grid = window.RegisteredControls.Grids["Artículos"];
if (grid.HasChanges() != true) {
Exertus.MainModalPanel.ShowText("Notificación", "No hay cambios que guardar.");
return;
}
if (grid.Validate() != true) {
return;
}
if (commandName === "DISCARD_CHANGES") {
var callback = function () {
var innerGrid = arguments.callee.Grid;
innerGrid.AddedEntities = [];
innerGrid.DeletedEntities = [];
innerGrid.Databind(innerGrid.OriginalEntities);
jQuery(innerGrid.Root).attr("class", "");
delete window.ModifiedGrids[innerGrid.Name];
Exertus.MainModalPanel.ShowText("Notificación", "Se han descartado los cambios.");
}
var grid = window.RegisteredControls.Grids.Artículos;
callback.Grid = grid;
Exertus.MainModalPanel.Confirm("Confirmación", "¿Confirma que desea descartar los cambios?", callback);
}
if (commandName === "CANCELAR") {
var callback = function () {
var innerGrid = arguments.callee.Grid;
innerGrid.AddedEntities = [];
innerGrid.DeletedEntities = [];
innerGrid.Databind(innerGrid.OriginalEntities);
jQuery(innerGrid.Root).attr("class", "");
delete window.ModifiedGrids[innerGrid.Name];
Exertus.MainModalPanel.ShowText("Notificación", "Se han cancelado los cambios.");
}
var grid = window.RegisteredControls.Grids["Carga De Archivos"];
callback.Grid = grid;
Exertus.MainModalPanel.Confirm("Confirmación", "¿Confirma que desea cancelar los cambios?", callback);
}
}
错误标记在第一行,第一行是空的,所以我不知道那可能是什么。
我的另一个问题是 Chrome 说我还没有定义一个函数,但是我已经在我所有需要定义它的文档中定义了它,你们能否告诉我是否有任何工具可以帮助我找出在哪里它没有定义吗?谢谢!