Welcome To Snipplr


Everyone's Recent JavaScript Snippets Tagged javascript



1 ... 15 16 17 18 19 ... 33
each in Array,It can operate each element in Array. e.g. var result = [1,2,3,4].each(function(x){return Math.sqrt(x);}); //it return sqrt in [1,2,3,4]'s each item
0 823 posted 15 years ago by hand4ever
The AJAX Libraries API is a content distribution network and loading architecture for the most popular, open source JavaScript libraries.
1 1181 posted 15 years ago by jonkemp
The Location object is part of a Window object and is accessed through the window.location property. It contains the complete URL of a given Window object, or, if none is specified, of the current Window object.
0 1008 posted 15 years ago by jonkemp
Although $(document).ready is incredibly useful, it occurs during page render while objects are still downloading. You can reduce CPU utilization during the page load by binding your jQuery functions to the $(window).load event, which occurs after al...
2 1017 posted 15 years ago by jonkemp
Use chaining in jQuery to reduce the code size and gain better performance.
0 983 posted 15 years ago by jonkemp
via [http://mir.aculo.us/2010/06/04/making-an-ipad-html5-app-making-it-really-fast/](http://mir.aculo.us/2010/06/04/making-an-ipad-html5-app-making-it-really-fast/) for CSS3 Transitions, Transforms, Animation also see: [http://css3.bradshawenterp...
0 1058 posted 15 years ago by cfleschhut
Simple template for setting up classes in JS
0 1263 posted 15 years ago by geekyjohn
This requires jQuery. The script checks to see if default text is present in a text field on focus. If it is, then it clears the text. Otherwise, it leaves user entered text intact. This is normally used for a search box.
0 1194 posted 15 years ago by jonkemp
Extremely simple random image when using similar naming structure and a set number of images (eg. imagePrefix_1,jpg, imagePrefix_2,jpg, etc.)
0 946 posted 15 years ago by d55beck
This is a script [tweeted by @gregmuellegger](http://twitter.com/gregmuellegger/status/16618146398). Example usage: Supports f("Hello %s.", ["World"]) and f("Hello %(name)s.", {name: "World"})
0 1347 posted 15 years ago by glends
If you need to sort an array in javascript this is how it should be done. Casting toLowerCase() is optional but but necessary if fx "Anne" was spelled "anne"
0 1177 posted 15 years ago by fengelz
JS to dynamically update year -- good for copyright.
0 1179 posted 15 years ago by mennyj
0 1151 posted 15 years ago by gabbo
based on [http://net.tutsplus.com/tutorials/javascript-ajax/create-a-simple-powerful-product-highlighter-with-mootools/](http://net.tutsplus.com/tutorials/javascript-ajax/create-a-simple-powerful-product-highlighter-with-mootools/)
0 935 posted 15 years ago by cfleschhut
converts date/time that sharepoint kicks out to m/d/y format.
0 1188 posted 15 years ago by rumremix
This is the correct markup for an inline script tag for HTML 4.01 and XHTML 1.0 Note the lack of any "language" attribute since this is deprecated. In HTML 4, the content type is declared as CDATA, which means that entities will not be parsed....
0 1404 posted 15 years ago by PapillonUK
Will convert all of the mysql dates on the page to be localized.
0 1149 posted 15 years ago by yisreldov
Just a simple benchmark utility, working both in AS2 & JS.
0 926 posted 15 years ago by irrevokable
Animated countdown in jQuery.
1 1019 posted 15 years ago by jaff
1 ... 15 16 17 18 19 ... 33