How to setup cloud9-ide to reference other Javascript files? -


i can't cloud9 reference functions/variables in other files. example set simple html5-app:

<!doctype html> <html>     <head>         <title>testapp</title>     </head>     <body>         <div id="menucontainer"></div>         <script type="text/javascript" src="js/lib.js"></script>         <script type="text/javascript" src="js/main.js"></script>     </body> </html> 

see, reference objects in lib.js within main.js:

var menu=new lib.menu('menucontainer',{'file','edit','about'}); 

but cloud9 editor warns me, lib unknown variable (and of course code completion out of question). under visualstudio try enforce reference like:

/// <reference path="js/lib.js" />  

is similiar possible in cloud9? how set up?

there isn't way cloud9 linter (cloud9 uses eslint lint javascript) know files loaded before file in html file, there way let linter know objects global not warn using undefined variables.

you can marking variables global, , can adding following line:

/*global var1, var2 */ 

where var1, , var2 2 global objects.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -