Welcome To Snipplr


Everyone's Recent JavaScript Snippets



1 ... 18 19 20 21 22 ... 65
Using an object as a simple switch.
0 958 posted 13 years ago by 1man
0 505 posted 13 years ago by gregorynicholas
Basically creates a log function on the window object and uses console.log or alert depending on which is supported. Very basic and simple but definitely useful.
0 753 posted 13 years ago by alvincrespo
Window.onload chaining using Namespaces.
0 522 posted 13 years ago by derdesign
Replace English numbers with Arabic numbers in browsers supporting Unicode & JavaScript. Credits to http://www.swalif.net/softs/swalif54/softs232281/
0 2355 posted 13 years ago by mooparmghor
Link body class names to trigger javascript. It requires jQuery.
0 820 posted 13 years ago by cmndo
Is very inefficient to attach a anonymous function event handlers to multiple items in a selection. The function is duplicated for each element. This shows how you can just create a single function and in the event handler callback just call that...
0 646 posted 13 years ago by anagaiyahoocom
Put in head tag
0 805 posted 13 years ago by stephcode
Don't forget to include jQuery validation plugin before this snippet. You can find it here: http://bassistance.de/jquery-plugins/jquery-plugin-validation/
0 1280 posted 13 years ago by racl101
Brilliant solution using Object.prototype.toString() Test cases included (commented out)
0 693 posted 13 years ago by wizard04
Enhanced cross-browser event handling
0 894 posted 13 years ago by wizard04
Returns an object with the `event.button` values of both the W3C and Microsoft models.
0 825 posted 13 years ago by wizard04
These functions allow you to set a handler for a mouseleave/enter event.
0 756 posted 13 years ago by wizard04
if you need ecmascript 5 functions then use underscore.js
0 761 posted 13 years ago by root_hacker
when need to created a dom element repeatedly , use string concatenation to avoid for loop you can use repeat function from below.
0 831 posted 13 years ago by root_hacker
this is the way for toggling something on mouse hover in and out
0 1018 posted 13 years ago by root_hacker
Safely loads a javascript file asynchronously Example: (function() { __safeLoadScript("http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js", function() { alert(jQuery); }); })();
0 670 posted 13 years ago by jasonseney
Activation: con Scope: source.js, source.js.jquery
0 733 posted 13 years ago by divtagged
0 529 posted 13 years ago by fadlee
This is implementation of pseudocode given in quicksort wikipedia page. Did it just for fun :)
0 638 posted 13 years ago by naren1012
1 ... 18 19 20 21 22 ... 65