Connecting Tech Pros Worldwide Help | Site Map

how to build a library in JS

  #1  
Old August 16th, 2006, 08:35 PM
bluesky
Guest
 
Posts: n/a
Hi All,
I am new to javascript and intend to build a custom library. After
saving independent files which contain separate functions, how does one
build the library?

Any help is a great help!! Thanks in advance

Thanks
ananth

  #2  
Old August 16th, 2006, 08:55 PM
Tom Cole
Guest
 
Posts: n/a

re: how to build a library in JS


You can either join all the .js files into one and distribute it, or
the end user will have to include each separate file with a <script
src="..."tag.

If the separate files have dependencies on other files, I would put
them together. I don't think there's any guarantee the browser will
process the .js files in the order they're specified.

  #3  
Old August 17th, 2006, 07:05 PM
Dr John Stockton
Guest
 
Posts: n/a

re: how to build a library in JS


JRS: In article <1155757562.795330.167700@b28g2000cwb.googlegroups .com>
, dated Wed, 16 Aug 2006 12:46:02 remote, seen in
news:comp.lang.javascript, bluesky <saradhi.ananth@gmail.composted :
Quote:
>I am new to javascript and intend to build a custom library.
Then you are probably trying to run before learning to walk.
Quote:
After
>saving independent files which contain separate functions, how does one
>build the library?
With a text editor.

In languages such as Borland Pascal and Delphi, one can include any
amount of library code in a compilation, and only the needed parts will
be included in the final executable. Web Javascript lacks such a
capability, and, as it is repeatedly transmitted over links which may be
slow, a thoughtful page author will be careful to send only what may be
used to his readers.

Your basic library should therefore be like a public library; users take
and use only what they want. It should not be like the traditional
Encyclopaedia, for which if you want to own any particular article
legitimately you need to buy and store the whole work.

Web site authors should package the routines that will be repeatedly
used in a site within one or more "include files", generally according
to topic; and each page should only call for the include files that it
will use.

Remember, though, that include files should be cached locally to the
reader.

Read the newsgroup and its FAQ.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/>? JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to submit two forms at a time mosesdinakaran@gmail.com answers 23 March 11th, 2007 10:25 AM
PRJ0002 Error Building Class Library Herman Jones answers 0 May 23rd, 2006 04:15 AM
JavaScript GUI library idea petermichaux@gmail.com answers 21 March 27th, 2006 05:15 PM
How to build Server app for auto repeat refresh display at the Bro Joe Shum answers 2 November 18th, 2005 06:20 PM