Welcome To Snipplr
Everyone's Recent JavaScript Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Matches the word starting with si or Si and containing : in the word also as an optional. The expression can be tested here http://rejex.heroku.com/
0
839
posted 13 years ago by punuhan
JavaScript
Set links with href to current page as active (or if in subnav set their parent to active)
look through the list items in your main nav and based on href of anchor tags this will set the top level link to have an 'active' class.
0
1145
posted 13 years ago by iammikecohen
See https://github.com/clemens/i18n_demo_app/blob/master/config/locales/de.yml for the source of the month names etc.
1
787
posted 13 years ago by riddla
This will check if object is an array object.
This will add isArray() method to Array native object. Can be used to check if passed in object is an array. Future ecmascript 5 will have this included. Can use this in the meantime.
Using instance...
0
833
posted 13 years ago by anagaiyahoocom
I love this script. It's perfect for anyone trying to transforms headlines into some sort of Title Case format without using CSS
0
834
posted 13 years ago by chrisaiv
A really fucking cool and easy way to calculate the alpha value for microsoft gradient using Javascript. Particularly useful in the Firebug console. Like a calculator.
0
714
posted 13 years ago by inreflection7
This will detect if console.log is available in browser and display the message. Otherwise will display as alert message
0
715
posted 13 years ago by anagaiyahoocom
This snippet lets you call a Javascript function declared within an IFrame from the parent element of the IFrame
0
1608
posted 13 years ago by alexscript
A tiny snippet on how to easily detect iPad/iPhone/iPod using javascript.
1
690
posted 13 years ago by parkarlsson
Extend Date object to have isLeapYear() boolean (true for Leap Years)
Taken from https://raw.github.com/vitch/jquery-methods/master/date.js
0
699
posted 13 years ago by tomasdev