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
685
posted 15 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
882
posted 15 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
653
posted 15 years ago by krunkosaurus
Can be applied to any element, but is most relevent when applied to an image.
2
830
posted 15 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
755
posted 15 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
2895
posted 15 years ago by kouphax
Simple jQuery snippet for cleanly and automatically setting up your google analytics
4
898
posted 15 years ago by garside
Thanks to [James](
http://www.girsbrain.org/blog
) for this code.
0
697
posted 15 years ago by zachharkey
object.forEach
=========
*Requires JavaScript 1.8*
`void object.forEach(function callback(item, value)[, thisObject])`
0
681
posted 15 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
661
posted 15 years ago by Sephr
Simple Javascript that will get a feed and parse it using Ajax
2
953
posted 15 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
880
posted 15 years ago by bcalloway
this function tells you whether or not the passed value is in the passed array
1
896
posted 15 years ago by jlvallelonga
this funciton returns an XMLHttpRequest object for use in ajax pages
1
860
posted 15 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
1013
posted 15 years ago by jrharshath
cross-browser document.getElementById, should be on top of code.
0
535
posted 15 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
983
posted 15 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
587
posted 15 years ago by username