Hi All,

Here I have a very newbie question here about how to invoke the functions 
been defined in external js files.

Assume here I have downloaded a js file has 100 functions and lots of 
global variables simply looks like:

abc.js
var a = 1;
var b = 2;
var c = 3;
...

function abc(x){...}
function cba(y){...}

.....
.....


So now in my main.js file, I simply want to make a call to functions looks 
like:
....

var v1 = abc(x);
var v2 = abc(y);

....

then I got an error about abc is not defined. That makes sense, so I guess 
I have to include the file or import functions in some way. I have seen 
some solution about export each function in abc.js, but there just too many 
of them. Also, if I have exported function abc, do I have to export those 
variables, a, b, c? I am so confused here. @_@

Thanks in advance.


-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/fae871a7-7379-4bcf-a45d-cae56e2bc2b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to