Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Javascript / Client Side Development

Javascript Directory to find all JScripts


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

On May 14, 9:11 pm, Mel <MelHer@gmail.com> wrote:

> 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
On May 15, 6:11 am, Mel <MelHer@gmail.com> wrote:

> 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

On May 15, 12:23 am, RobG <r@iinet.net.au> wrote:

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.

<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/webapps/serving-javascript-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.

On May 15, 4:22 am, -Lost <maventheextrawo@techie.com> wrote:

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.
In comp.lang.javascript message <1179173519.402324.168@w5g2000hsg.goo
glegroups.com>, Mon, 14 May 2007 13:11:59, Mel <MelHer@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.

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc