Welcome To Snipplr
Everyone's Recent Snippets Tagged javascript
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
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
1196
posted 13 years ago by pumpkinthehead
This code snippet fetches the very latest minified version of jQuery from Google's CDN. If this is not available, we revert to a locally stored version (current version at time of publish was 1.7.1 - update this to suit going forward).
1
1157
posted 13 years ago by Huskie
Esto es por si estamos desarrollando una aplicación en la cual necesitamos manejar la fecha y hora con javascript.
0
866
posted 13 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
723
posted 13 years ago by goo
There are 2 jQuery snippets, both replace broken images with one of your choosing, the difference is that one is "safe" and the other is "persistent". The safe one will quick working, so if your doing something that dynamically changed images on a pa...
3
1153
posted 13 years ago by FatFolderDesigner
A complete HTML page for a Facebook "app" that does login entirely on the client.
1 - Create a Facebook application (see Facebook developer docs.).
2 - Because of a Facebook "bug" the app should have Sandbox Mode disabled (App Settings - Advanced -...
8
1937
posted 13 years ago by rlmcneary2
When you use the `+` operator on an Array, it converts it to a string.` [].toString()` is the same as `[].join(',')`, which gives an empty string in case the array value is `undefined` or `null`. This also works in Javascript `([undefined] + "b" ===...
0
710
posted 13 years ago by luizlopes
an operator that implements true prototypal Object inheritance in JavaScript
0
883
posted 13 years ago by luizlopes
JSLint requires the body of every `for in` statement should be wrapped in an `if` statement
0
1017
posted 13 years ago by luizlopes
Show Hide table data uses href, anchors, div tags, and javascript to toggle between showing and hiding a table on the html page.
0
751
posted 13 years ago by richtt
this function gets a parameter like an hex color (es: "#ffffff"), an abbreviated hex color (es: "#fff"), an rgb color (es: "rgb(255,255,255)") or an rgba color (es: "rgba(255,255,255,1)"), and returns an object containing the rgba values, like { red:...
0
2165
posted 13 years ago by claudiowebdesign
wrote this snippet as a necessity to preload many images without writing same code all the time in JS...
0
915
posted 13 years ago by alik
jQuery to set the width of some text to the width of a given element.
0
1028
posted 13 years ago by Narthur
A quick, simple example of using Lawnchair to store and retrieve data for a jQuery Mobile based PhoneGap project. Written by a JavaScript newbie.
0
869
posted 13 years ago by ryanstewart
Highly customizable search widget for Google+ that is inspired by Twitter widgets. This widget searches across the body and comments of public posts and displays a summarized version of matching posts with any attached images.
0
808
posted 13 years ago by mikemore
Dynamically add <label> HTML tag to input description, matching the input by adding an ID value to the input.
0
922
posted 13 years ago by jbernus
two awesome bits: using ''.replace() perform an action (other than replacing it) on some text, and a simple way to concatenate strings with a separator (retardedly simple but it always confuses me)
0
885
posted 13 years ago by ultranaut
http://stackoverflow.com/questions/3628649/javascript-self-contained-sandbox-events-and-client-side-stack
0
942
posted 13 years ago by ultranaut