Welcome To Snipplr
Everyone's Recent JavaScript Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
This was created as a temporary solution to the wide dropdowns that sometimes appear in OpenAir timesheets and cause horizontal scrolling. Adding this script as a bookmarklet and clicking it will resize all selects (dropdowns) on a page to 340px wide...
0
673
posted 17 years ago by Todd
SEE http://json.org/ for PHP JSON Libraries.
grunt knuckle drag brute force ugly escapes for quotes make a php array a json string
Produces trailing commas which some Javascript Librarys can't deal with.*
_*NOOB NOTE [a comma is added at the...
2
1069
posted 17 years ago by inkdeep
This routine is loosely based on elightbo's "Calculate Business Days" snippet in ASP, with some process & logic modifications (most notably accounting for situations when both dates fall on a weekend) and a translation to JavaScript.
0
4673
posted 17 years ago by Bluebeard
Very basic way to toggle an element to slide in and out using mootools 1.1. Uses FX.Slide, other transitions are available.
2
911
posted 17 years ago by 1man
The setTimeout ensures that if there is an issue attaching the link to the bottom of the head (e.g. if the head hasn’t finished loading when the link is trying to be attached) it retries after 100ms. Resetting the css variable to null avoids potent...
1
1292
posted 17 years ago by natalie
Script takes links that are not on your domain and opens them in a new window. This code allows for XHTML strict validation and meets Accessibility criteria on opening new windows.
5
1051
posted 17 years ago by skatan
A way to call a function before the window is unloaded/refreshed/etc. Used in the first E-shot Management System. Useful for auto-saving data/content before the window is closed or refreshed.
1
902
posted 17 years ago by andyhartleeds
a function that returns the absolute position in DOM tree. jQuery based
1
785
posted 17 years ago by fael
Create a simple object and add properties and a method. Note where the object is parsed (not from top to bottom).
2
790
posted 17 years ago by 1man
This utility function attaches listeners to a text field or text area. It supports default text for instructional copy. The original text in the field is used as the instructional/default text. When the box gets focus, it disappears and the user can...
0
791
posted 17 years ago by elli