473,386 Members | 1,842 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

Aug 16 '06 #1
2 1368
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.

Aug 16 '06 #2
JRS: In article <11**********************@b28g2000cwb.googlegroups .com>
, dated Wed, 16 Aug 2006 12:46:02 remote, seen in
news:comp.lang.javascript, bluesky <sa************@gmail.composted :
>I am new to javascript and intend to build a custom library.
Then you are probably trying to run before learning to walk.
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.
Aug 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Phil | last post by:
I realize this is the php group, but I have a question that recurses back to my php install. My objective is a pure 64 bit shared object installation of php 5.0 on UltraSparc Solaris 9 compiled...
15
by: grunar | last post by:
After some thought on what I need in a Python ORM (multiple primary keys, complex joins, case statements etc.), and after having built these libraries for other un-named languages, I decided to...
2
by: hubert_s | last post by:
I have DB2 8.1 FP7, when I try to build a Java stored procedure it fails during a call to DB2_REPLACE_JAR. Even the build folder "bld1096553970703" is not there - it has a different name, ...
3
by: Chuck Conlow | last post by:
Greetings. I'm using the Personal (I think that's what it's called) edition of VS C# and I want to build a .dll, which is not an option presented in the IDE. I *think* I can build one from the...
7
by: SteveB | last post by:
Being a C++ developer, I'm not used to a build performing automagically. For instance, App.config automatically being renamed and placed in the bin\debug folder and project.en-US.resx resource files...
7
by: dm_dal | last post by:
I have a solution in VS.Net 2003. It contains 1 - asp.net project(c#), 1 - c# class library project and 1 - db project. When I try to build the solution, I get the following error: Could not...
4
by: P.Kienzle | last post by:
When I try to run the Build for the Enterprise Library, I get several messages referring to the .csproj files... stating that they are not installed (see below). They are located at the directory...
4
by: nmrcarl | last post by:
I'm trying to upgrade a large project from VS 6.0 to VS 2005. After fixing a lot of things that changed (mostly sloppy coding in the original project that VS2005 didn't allow), I got the release...
2
by: 2b|!2b==? | last post by:
I am having linkage errors in my release build as ff: ------ Build started: Project: myModule, Configuration: Release Win32 ------ Linking... Creating library c:\mypath\myModule.lib and object...
3
by: mnjkahn via AccessMonster.com | last post by:
I'm running Access 2003, modifying a query that has over 45 fields. When I right click on the field name in Query Design View, and then click Build, Access crashes before the Build window...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.