Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Mar 2005
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool Can you pass variables to libraries?

    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.

  • #2
    Regular Coder
    Join Date
    Aug 2004
    Location
    codegoboom@yahoo.com
    Posts
    999
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by suendisra
    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?
    *this message will self destruct in n-seconds*

  • #3
    New Coder
    Join Date
    Mar 2005
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    what site?

    Quote Originally Posted by codegoboom
    Intriguing, but vague... what site?
    http://www.javascriptkit.com/javatutors/external.shtml

  • #4
    Regular Coder
    Join Date
    Aug 2004
    Location
    codegoboom@yahoo.com
    Posts
    999
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ah, "the site"...
    *this message will self destruct in n-seconds*

  • #5
    Regular Coder
    Join Date
    Aug 2004
    Location
    codegoboom@yahoo.com
    Posts
    999
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah, it looks like arguments (parameters) are what you're thinking of...
    *this message will self destruct in n-seconds*

  • #6
    New Coder
    Join Date
    Mar 2005
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    so....

    are you then saying that it works like that? I can pass variables to a JS Library?

  • #7
    Regular Coder
    Join Date
    Aug 2004
    Location
    codegoboom@yahoo.com
    Posts
    999
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    *this message will self destruct in n-seconds*


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •