Welcome To Snipplr
Everyone's Recent JavaScript Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Validating a decimal such as a measurement of time or currency (10.5 or 0.4). This function will return the correct number. If you feed in "10.5foo" the function will spit back 10.5. If you feed in "bar" the function will return nothing.
0
801
posted 16 years ago by blackf0rk
dynamic background images flickers in IE6
***
more ressources:
[here](http://misterpixel.blogspot.com/2006/09/forensic-analysis-of-ie6.html)
and [here](http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B823727) and
[here](http://ajaxia...
0
1002
posted 16 years ago by localhorst
Here's a quick snippet of code to raise the minimum age of your site. Note that it is illegal to lower the legal age of your site under 13.
Legal Disclaimer: Affiliate shall indemnify and hold KickApps, its licensors and each such party's parent o...
0
772
posted 16 years ago by krunkosaurus
Can be applied to any element, but is most relevent when applied to an image.
2
938
posted 16 years ago by Unreal
This script stores the elements of the email address as JavaScript
variables and assembles them on the fly every time the page loads. The
page rendered looks the same to users, but the address never actually lives
in the page source code. It can...
0
862
posted 16 years ago by Bluewall
Simple function for turning RETURN key presses into TAB key presses. Focuses input element next in the DOM (usually makes sense), unless we are at the end of the form, at which point it focuses the first element in the form for cyclical purposes.
2
3059
posted 16 years ago by kouphax
Simple jQuery snippet for cleanly and automatically setting up your google analytics
4
1019
posted 16 years ago by garside
Thanks to [James](
http://www.girsbrain.org/blog
) for this code.
0
807
posted 16 years ago by zachharkey
object.forEach
=========
*Requires JavaScript 1.8*
`void object.forEach(function callback(item, value)[, thisObject])`
0
796
posted 16 years ago by Sephr
Get Function Name
============
This will only return (a string) if the object passed to getFunctionName is a function or an "object" function from IE.
The function does not rely on function.name if present as it can't always be trusted.
Examp...
0
779
posted 16 years ago by Sephr
Simple Javascript that will get a feed and parse it using Ajax
2
1093
posted 16 years ago by chrisaiv
jQuery client-side form validation for the Radiant CMS mailer extension.
Requires jQuery 1.2.6+
Each required field needs a class of "required" assigned to the input tag.
0
1008
posted 16 years ago by bcalloway
this function tells you whether or not the passed value is in the passed array
1
1009
posted 16 years ago by jlvallelonga
this funciton returns an XMLHttpRequest object for use in ajax pages
1
1010
posted 16 years ago by jlvallelonga
This is a script that can parse a URL string, and return all components in a systematic way via an object.
This script is very useful in places where you want to link to a page "dynamically" generated by javascript. This is usually done by adding GE...
2
1116
posted 16 years ago by jrharshath
cross-browser document.getElementById, should be on top of code.
0
637
posted 16 years ago by sarfraznawaz2005
Rather than using target="_blank", which is deprecated by the W3C in XHTML, you should use rel="external" for links that you want to pop out in a new window. This is the javascript that makes it happen.
0
1124
posted 16 years ago by chippper
This snippet assumes that you have a container `div` with an id of "images".
It also assumes that each img element inside your container div has the CSS property `visibility: hidden`
0
697
posted 16 years ago by username