Use of implicitly declared global variable

https://stackoverflow.com/questions/7604419/resharper-javascript-use-of-implicitly-declared-global-variable-x/8132307

https://github.com/taye/interact.js/issues/233

Assume you have two global variables, and the name of variable is confirmTranslation and selectAllTranslation, these variables are definite in ascx(Asp.Net) file.

<script>
        var selectAllTranslation = "";
        var urlGetPageTranslation = '';
 </script>

And you use these global variable in another js file, such as test.js.

Then you need add following code at the top of that JavaScript file

/* global confirmTranslation, selectAllTranslation */

猜你喜欢

转载自www.cnblogs.com/chucklu/p/9301374.html
今日推荐