473,403 Members | 2,222 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,403 software developers and data experts.

Javascript Directory to find all JScripts

Mel
is there a way of pointing to a directory where all JScripts are
living and let it pick and choose what it needs from which scripts or
do I have to do the picking through files each time I write a script
that depends on others ?

sorry if its a newbeeeee question, but had to ask.

I did Google but could not find anything

May 14 '07 #1
6 1306
On May 14, 9:11 pm, Mel <MelHer...@gmail.comwrote:
is there a way of pointing to a directory where all JScripts are
living and let it pick and choose what it needs from which scripts or
do I have to do the picking through files each time I write a script
that depends on others ?

sorry if its a newbeeeee question, but had to ask.

I did Google but could not find anything
you could write a function that conditionally includes other files
based on what it needs, you should check out the conditional include
amde at the end of the scriptaculous library

May 14 '07 #2
On May 15, 6:11 am, Mel <MelHer...@gmail.comwrote:
is there a way of pointing to a directory where all JScripts are
living and let it pick and choose what it needs from which scripts or
do I have to do the picking through files each time I write a script
that depends on others ?
The usual idea is to bundle all the script you need for a site into a
small number of script files (say one to three) then minify them. Use
the same set of scripts on every page so they are cached and your
visitors should only need to load them once in a while. Manage
scripts on a per site basis.

Don't use conditional script loading unless you can prove quantifiable
benefits - the overhead in using them from the added complexity when
maintaining a site is nearly always way out of proportion to the
minimal perceived benefits.
--
Rob

May 14 '07 #3
On May 15, 12:23 am, RobG <r...@iinet.net.auwrote:
On May 15, 6:11 am, Mel <MelHer...@gmail.comwrote:
is there a way of pointing to a directory where all JScripts are
living and let it pick and choose what it needs from which scripts or
do I have to do the picking through files each time I write a script
that depends on others ?

The usual idea is to bundle all the script you need for a site into a
small number of script files (say one to three) then minify them. Use
the same set of scripts on every page so they are cached and your
visitors should only need to load them once in a while. Manage
scripts on a per site basis.

Don't use conditional script loading unless you can prove quantifiable
benefits - the overhead in using them from the added complexity when
maintaining a site is nearly always way out of proportion to the
minimal perceived benefits.

--
Rob
I agree with that, and also I would say that you can get great
compression with mod_deflate or gzip. Obviously if you have an app
which required 6 js pages, why not simply make 1 large page, avoid the
other 5 requests, and use deflate to compress the source to 15% of its
original size, no minifying needed.

May 15 '07 #4
shimmyshack wrote:
On May 15, 12:23 am, RobG <r...@iinet.net.auwrote:
>On May 15, 6:11 am, Mel <MelHer...@gmail.comwrote:
>>is there a way of pointing to a directory where all JScripts are
living and let it pick and choose what it needs from which scripts or
do I have to do the picking through files each time I write a script
that depends on others ?
The usual idea is to bundle all the script you need for a site into a
small number of script files (say one to three) then minify them. Use
the same set of scripts on every page so they are cached and your
visitors should only need to load them once in a while. Manage
scripts on a per site basis.

Don't use conditional script loading unless you can prove quantifiable
benefits - the overhead in using them from the added complexity when
maintaining a site is nearly always way out of proportion to the
minimal perceived benefits.
<snip sig>
I agree with that, and also I would say that you can get great
compression with mod_deflate or gzip. Obviously if you have an app
which required 6 js pages, why not simply make 1 large page, avoid the
other 5 requests, and use deflate to compress the source to 15% of its
original size, no minifying needed.
I would see:
http://www.thinkvitamin.com/features...avascript-fast on
the appropriateness of mod_gzip in comparison to mod_deflate.

There are plenty of articles on this actually.

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
May 15 '07 #5
On May 15, 4:22 am, -Lost <maventheextrawo...@techie.comwrote:
shimmyshack wrote:
On May 15, 12:23 am, RobG <r...@iinet.net.auwrote:
On May 15, 6:11 am, Mel <MelHer...@gmail.comwrote:
>is there a way of pointing to a directory where all JScripts are
living and let it pick and choose what it needs from which scripts or
do I have to do the picking through files each time I write a script
that depends on others ?
The usual idea is to bundle all the script you need for a site into a
small number of script files (say one to three) then minify them. Use
the same set of scripts on every page so they are cached and your
visitors should only need to load them once in a while. Manage
scripts on a per site basis.
Don't use conditional script loading unless you can prove quantifiable
benefits - the overhead in using them from the added complexity when
maintaining a site is nearly always way out of proportion to the
minimal perceived benefits.

<snip sig>
I agree with that, and also I would say that you can get great
compression with mod_deflate or gzip. Obviously if you have an app
which required 6 js pages, why not simply make 1 large page, avoid the
other 5 requests, and use deflate to compress the source to 15% of its
original size, no minifying needed.

I would see:http://www.thinkvitamin.com/features...ascript-faston
the appropriateness of mod_gzip in comparison to mod_deflate.

There are plenty of articles on this actually.

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
that is true... it's harder to setup for mod_deflate, as browsers
generally ask for gzip, although the argument is valid, I haven't to
date found anyone who has been tripped up by gzip. If your server is
beefy enough to handle it great, else look for the accept-encoding
deflate, and serve that if at all possible I agree.
Theres also another valid point on that link, if you have a HUGE file
of js, then make sure you wont have to make changes to it, or you will
force a download of that file, on the plus side even if you start with
200k of js which is a lot, it will generally hover around 36k
compressed, which isnt too bad - the cost of an image.

May 15 '07 #6
In comp.lang.javascript message <11**********************@w5g2000hsg.goo
glegroups.com>, Mon, 14 May 2007 13:11:59, Mel <Me*******@gmail.com>
posted:
>is there a way of pointing to a directory where all JScripts are
living and let it pick and choose what it needs from which scripts or
do I have to do the picking through files each time I write a script
that depends on others ?
To the question as asked, AFAIK no, at run time.

An author can of course write an authoring tool that, given the name of
a function or other variable, will search within a directory and import
its definition.

My "javascript library" is contained within about 5 *.js files,
classified by topic, and on each page that needs to use routines from it
I include the corresponding file by reference, by for example
<script type="text/javascript" src="include1.js"></script>

See <URL:http://www.merlyn.demon.co.uk/js-nclds.htm.>

Normally I know which file a function is in; otherwise, I use a search
tool such as MiniTrue.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6.
Web <URL:http://www.merlyn.demon.co.uk/- FAQish topics, acronyms, & links.
I find MiniTrue useful for viewing/searching/altering files, at a DOS prompt;
free, DOS/Win/UNIX, <URL:http://www.idiotsdelight.net/minitrue/unsupported.
May 15 '07 #7

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

Similar topics

0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.