Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old August 16th, 2006, 08:35 PM
bluesky
Guest
 
Posts: n/a
Default how to build a library in JS

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
Default 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
Default 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.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,248 network members.