...

View Full Version : Can you pass variables to libraries?



suendisra
03-20-2005, 08:49 PM
I was wondering if you could pass variables to a library. Also, can a library hold more than one function? I noticed on the site that in a library, it held one function, but all the variables were static; created by the library. As such, I was wondering if I could create a 'giant' library filled with all the functions I wanted, and then recall them in any code.

codegoboom
03-20-2005, 09:59 PM
I noticed on the site that in a library, it held one function, but all the variables were static; created by the library.

Intriguing, but vague... what site? :confused:

suendisra
03-20-2005, 10:26 PM
Intriguing, but vague... what site? :confused:

http://www.javascriptkit.com/javatutors/external.shtml :thumbsup:

codegoboom
03-20-2005, 10:29 PM
Ah, "the site"... :D

codegoboom
03-20-2005, 10:34 PM
Yeah, it looks like arguments (parameters) are what you're thinking of... :)

suendisra
03-20-2005, 11:11 PM
are you then saying that it works like that? I can pass variables to a JS Library? :confused:

codegoboom
03-21-2005, 09:34 AM
Right, it's not really a library... but a function in an external script file. One can send/receive values from those, just like any other function, I presume, because they exist as part of the host environment.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum