Welcome To Snipplr


Everyone's Recent JavaScript Snippets



1 ... 8 9 10 11 12 ... 65
The usual way to shuffle an array uses the .sort() method with Math.round(Math.random())-0.5 This solution is highly biased based on the sort algorithm used by the browsers. A sort comparison operation has to fulfill the condition "if a>b then b<a"...
0 549 posted 12 years ago by devnull69
Some FB apps are longer than the 800px default FB limit and most are designed to 520px. When your content is longer than the 800px default a verticle scroll bars appears and if you have a hard-coded width in your CSS of 520px this forces a horizontal...
0 638 posted 12 years ago by the_construct
Convert a form submit button code to a hyperlink code and hide the form
0 598 posted 12 years ago by pavlosvos
Usage: &lt;a href="http://www.whaterver-your-site-is-called.com/" rel="external"&gt;Some other site&lt;/a&gt;
0 770 posted 12 years ago by Krummelz
Aggiungere un Modulo
0 551 posted 12 years ago by kajinka13
Load in runtime di file js
0 591 posted 12 years ago by kajinka13
Converte tutti gli \n in <br>
0 563 posted 12 years ago by kajinka13
Coordinate su Gmaps
0 525 posted 12 years ago by kajinka13
Convert javascript comma separated string into an array
0 697 posted 12 years ago by praveenius
How to check Html element type
0 580 posted 12 years ago by caringprogrammer
Add trim method to String class
0 699 posted 12 years ago by kajinka13
If you a flick a web app past the bottom or top of the page, the page itself gets elastically tugged away from the URL bar or the button bar (or the bottom/top of the screen if it's in full-screen mode). This behavior is another giveaway that your...
0 604 posted 12 years ago by timothypwalter
Grab jQuery library from Google's CDN this way its faster, burns Google's bandwidth and not yours. Also users will have this cached if other sites are using it as well. Downside of course is Google's servers do go down. This script will check if...
1 700 posted 12 years ago by cyberpunkstudio
The Google Closure lets you get DOM elements with getElement( id ) and getElementByClass( class ). This function combines the two to let you get elements similarly to the way jQuery does. E.g. getElement( '#home .sidebar #links') returns the elemen...
0 880 posted 12 years ago by cjcenizal
Usually when working with form you use a server to handle it, and if your doing it entirely in javascript no reload is required, but what if you wanted to take the information and use it in a javascript on another page, completely client side. I had...
0 913 posted 12 years ago by FatFolderDesigner
Go through all the authors of a wordpress import and make them the same as the previous authors (Wordpress 3.3).
0 668 posted 12 years ago by jcottrell
Delete a page of wordpress posts with one click ("Run" in Firebug or Developer Tools)
0 550 posted 12 years ago by jcottrell
Find the date with or without a year and with double or single digit month or day. Easily extendable to other date delimiters and formats.
0 844 posted 12 years ago by pumpkinthehead
extends the default varien "tabs" class to allow other links on the page to open a tab
0 654 posted 12 years ago by flintcreative
How to get extract method for zipfile module to work with Ti 1.8 sdk.
0 672 posted 12 years ago by lspellman
<p>This is how the extract method is documented for use. In the next example, we show how it actually should be used for Ti 1.8</p>
0 562 posted 12 years ago by lspellman
Esto es por si estamos desarrollando una aplicación en la cual necesitamos manejar la fecha y hora con javascript.
0 605 posted 12 years ago by jrobinsonc
In JavaScript, there are 6 "falsy" values (values that evaluate to false): false, null, undefined, 0, "" (the empty string), and NaN Anything else evaluates to true.
0 433 posted 12 years ago by goo
This will return the value of "param" form the URI. For example if you have www.example.com/index.html?param=some_value it will return "some_value". NOTE! This only works if you use Prototype JavaScript framework.
0 692 posted 12 years ago by srka
na
0 696 posted 12 years ago by stavelin
Helps to manage console.log debug in js when broswing in IE. If alertFallback is enabled, you can see js alerts appears of vars tracked.
0 654 posted 12 years ago by Simounet
By not being limited to provide certain arguments/parameters in right order when calling a function, makes the function more versatile and easier to extend without breaking old code (e.g. calls to the function). One solution is to pass an associati...
0 801 posted 12 years ago by coprolit
1 459 posted 12 years ago by otternq
Sorts a list by its 'data-' attribute. Customization is very easy.
0 783 posted 12 years ago by inreflection7
The Javascript code to activate a CSS transition.
0 544 posted 12 years ago by tpryan
1 ... 8 9 10 11 12 ... 65