[英]I can not change the function name in .js file. What is wrong?
I am facing a problem after changing the name of a function inside a.js file.在 a.js 文件中更改 function 的名称后,我遇到了问题。 I do not know what I am doing wrong?
我不知道我做错了什么?
index.html index.html
<div class="form-group">
<select class="form-control" id="env" name="env" onchange="loadClusters()">
<option value="" disabled selected>Environment </option>
exec.js exec.js
function loadClusters() {
window.location.href = "/execution?env=" + $('#env').val() + '&type=' + $('#type').val();
}
When I change the name of the function to loadCluster
, for example, it is not working.例如,当我将 function 的名称更改为
loadCluster
时,它不起作用。
Plz note that when you import the function from exec.js, the function's name(ie the name of function being imported) should start with a capital letter.请注意,当您从 exec.js 导入 function 时,函数的名称(即导入的 function 的名称)应以大写字母开头。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.