Connecting Tech Pros Worldwide Help | Site Map

library of practical JavaScript examples

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 18th, 2006, 04:25 PM
Manne
Guest
 
Posts: n/a
Default library of practical JavaScript examples

I'm looking for a library of practical JavaScript examples. Can you
recommend any?
Thanks for your time.


  #2  
Old July 18th, 2006, 05:25 PM
Matt Kruse
Guest
 
Posts: n/a
Default Re: library of practical JavaScript examples

Manne wrote:
Quote:
I'm looking for a library of practical JavaScript examples. Can you
recommend any?
Could you be more vague?

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com


  #3  
Old July 19th, 2006, 12:05 AM
Kevin Darling
Guest
 
Posts: n/a
Default Re: library of practical JavaScript examples


Manne wrote:
Quote:
I'm looking for a library of practical JavaScript examples. Can you
recommend any?
Depends. Are you experienced or just starting out with the language.
If the latter, try looking though the examples at the bottom of this
page:

http://irt.org/script/script.htm

Otherwise, you'll need to be more specific as to what kind of examples
you're looking for... some sites specialize.

Kev

  #4  
Old July 19th, 2006, 10:45 PM
Dr John Stockton
Guest
 
Posts: n/a
Default Re: library of practical JavaScript examples

JRS: In article <1153239860.785630.301870@s13g2000cwa.googlegroups .com>
, dated Tue, 18 Jul 2006 09:24:20 remote, seen in
news:comp.lang.javascript, Manne <manne@merseymail.composted :
Quote:
>I'm looking for a library of practical JavaScript examples. Can you
>recommend any?
No.

Be warned : many such are old and contain amateurish coding.

Be particularly wary of those which allow almost anyone to contribute
almost anything without applying quality control.

For example, one such site contains code obviously copied (without
permission) from my site; but it has been so carelessly copied as to be
of little use as it stands.

When using libraries, remember that the whole of a page, and of the
include files that it uses, must in general be transmitted to the
reader, who may be on a radio or dial-up link. Therefore, use the sort
of library that allows you substantially to select, as an author, only
code which will be executed, and avoid the sort which provides only vast
multi-purpose chunks.

Watch out also for those who code for one specific version of one
browser.

--
© 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.
  #5  
Old July 20th, 2006, 03:55 AM
Matt Kruse
Guest
 
Posts: n/a
Default Re: library of practical JavaScript examples

Dr John Stockton wrote:
Quote:
Therefore, use the
sort of library that allows you substantially to select, as an
author, only code which will be executed, and avoid the sort which
provides only vast multi-purpose chunks.
Two points:

1) In many cases, you can't determine which code will be executed. You can
often only determine which code can _possibly_ be executed.

2) If 5 different pages each use 50% of a 10k "multi-purpose chunk" of code,
it is better to deliver the 10k chunk once and let the browser cache it (10k
total download) vs. delivering 5k of page-specific code 5 times (25k total
downloaded).

I favor writing smaller "multi-purpose chunks" of compacted code, and having
the page select which ones it needs to include. Then you can properly
benefit from caching, include only the small libs which you actually need on
the page, and have a single lib which doesn't have to be cut up and
delivered in smaller chunks.

Further, the creation of "multi-purpose chunks" facilitates code sharing and
reuse (see my sites below) while code written by dissenting authors is often
not shared for others to benefit from.

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com


  #6  
Old July 20th, 2006, 05:05 PM
Manne
Guest
 
Posts: n/a
Default Re: library of practical JavaScript examples

Sorry that was a bit vague. I do have some knowledge of programming and
web development. I've read the core guide and feel I could have a go
messing around with other peoples examples.
I was looking for something like this http://rebol.org/ where people
can upload examples of there JS work. The site makes it easy to search
for stuff you might be interested in.

  #7  
Old July 20th, 2006, 10:35 PM
Dr John Stockton
Guest
 
Posts: n/a
Default Re: library of practical JavaScript examples

JRS: In article <e9mtuo01fq9@news4.newsguy.com>, dated Wed, 19 Jul 2006
22:40:01 remote, seen in news:comp.lang.javascript, Matt Kruse
<newsgroups@mattkruse.composted :
Quote:
>Dr John Stockton wrote:
Quote:
>Therefore, use the
>sort of library that allows you substantially to select, as an
>author, only code which will be executed, and avoid the sort which
>provides only vast multi-purpose chunks.
>
>Two points:
>
>1) In many cases, you can't determine which code will be executed. You can
>often only determine which code can _possibly_ be executed.
True, which is why I included "substantially". And "be executed" must
of course include all accesses.

It is bad, for example, to import a complete
function DateObjectFromString(Str, WhichOfVeryManyFormats)
into a page which will only use a single hard-coded value for the second
argument.

<URL:http://www.merlyn.demon.co.uk/js-date4.htm#Genl contains such a
function, but much of the functionality is provided in chunks marked
//optional paragraph
Quote:
>2) If 5 different pages each use 50% of a 10k "multi-purpose chunk" of code,
>it is better to deliver the 10k chunk once and let the browser cache it (10k
>total download) vs. delivering 5k of page-specific code 5 times (25k total
>downloaded).
If all five pages will be fetched. But the longer it takes for the
first page to be fetched, the more likely the reader is to give up and
go elsewhere.

--
© 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.
  #8  
Old July 21st, 2006, 02:25 AM
Matt Kruse
Guest
 
Posts: n/a
Default Re: library of practical JavaScript examples

Dr John Stockton wrote:
Quote:
It is bad, for example, to import a complete
function DateObjectFromString(Str, WhichOfVeryManyFormats)
into a page which will only use a single hard-coded value for the
second argument.
If the function is only a few k, then it is certainly not bad. Far better
than including a typical image in a web page.
Quote:
Quote:
>2) If 5 different pages each use 50% of a 10k "multi-purpose chunk"
>of code, it is better to deliver the 10k chunk once and let the
>browser cache it (10k total download) vs. delivering 5k of
>page-specific code 5 times (25k total downloaded).
If all five pages will be fetched. But the longer it takes for the
first page to be fetched, the more likely the reader is to give up and
go elsewhere.
Don't be dramatic. Many pages have 50k or more of images on them. People
don't leave.
Including 10k, 20k, 30k, or more of cache-able javascript is certainly no
worse, and I've never known anyone to actually abandon a site because of
reasonable-size javascript code being delivered to the browser.

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com


 

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 220,989 network members.