简体   繁体   English

我无法在 .js 文件中更改 function 名称。 怎么了?

[英]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时,它不起作用。

  1. Clear The Cached browser data.清除缓存的浏览器数据。 If you are using chrome:如果您使用的是铬:

Settings --> More tools --> Clear browsing data --> Cached images and files设置 --> 更多工具 --> 清除浏览数据 --> 缓存图像和文件

  1. Invalidate the cached data in your IDE.使 IDE 中的缓存数据无效。
  2. Disable Caching your Chrome browser:禁用缓存您的 Chrome 浏览器:

Settings --> More tools --> Developer tools --> Network --> Disable Cache.设置 --> 更多工具 --> 开发者工具 --> 网络 --> 禁用缓存。

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.

相关问题 我可以添加ajaxComplete .js文件吗? - Can I add in ajaxComplete a .js file.? 我很难弄清楚我的html和js文件出了什么问题。 我需要数元音 - I am having a hard time figuring out what is wrong with my html and js file. I need to count the vowels 在浏览器中生成 corrupt.xlsx 文件的 Sheet.js 代码。 我的代码有什么问题? - In-browser Sheet.js code generating corrupt .xlsx file. What's wrong with my code? 这个js函数有什么问题? - What is wrong with this js function? JS变量包含PDF或DOC文件。 如何为用户传递此文件? - JS variable contains PDF or DOC File. How I can pass this file for user? 如何从给定的函数名称中找到函数定义的js文件名? - How can I find the js file name of the function definition from given function name? 在另一个JS文件中调用全局函数。 我如何获得“这个”的作用? - Calling a global function in another JS file. How do I get 'this' to work? gulp build不输出文件。 我哪里做错了? - gulp build not outputing file. Where did I go wrong? 我希望将 javascript 中该函数的函数名称和主体解析为一个单独的文件。 我如何使用 Java 做到这一点? - I want the function name and body of that function from a javascript to get parsed out into a separate file. How do I do that using Java? 我需要单击自定义按钮打开文件资源管理器,以便我可以选择一个文件。 并且该文件名必须出现在 INPUT 字段中 - I need to open the the file explorer on the click of a CUSTOM BUTTON so that i can select a file. And that file name has to appear in the INPUT field
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM