Welcome To Snipplr


Everyone's Recent JavaScript Snippets



1 ... 18 19 20 21 22 ... 65
Using an object as a simple switch.
0 731 posted 13 years ago by 1man
0 401 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 604 posted 13 years ago by alvincrespo
Window.onload chaining using Namespaces.
0 403 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 2095 posted 13 years ago by mooparmghor
Link body class names to trigger javascript. It requires jQuery.
0 650 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 508 posted 13 years ago by anagaiyahoocom
Put in head tag
0 626 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 1059 posted 13 years ago by racl101
Brilliant solution using Object.prototype.toString() Test cases included (commented out)
0 539 posted 13 years ago by wizard04
Enhanced cross-browser event handling
0 718 posted 13 years ago by wizard04
Returns an object with the `event.button` values of both the W3C and Microsoft models.
0 648 posted 13 years ago by wizard04
These functions allow you to set a handler for a mouseleave/enter event.
0 589 posted 13 years ago by wizard04
if you need ecmascript 5 functions then use underscore.js
0 620 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 674 posted 13 years ago by root_hacker
this is the way for toggling something on mouse hover in and out
0 832 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 536 posted 13 years ago by jasonseney
Activation: con Scope: source.js, source.js.jquery
0 583 posted 13 years ago by divtagged
0 408 posted 13 years ago by fadlee
This is implementation of pseudocode given in quicksort wikipedia page. Did it just for fun :)
0 486 posted 13 years ago by naren1012
1 ... 18 19 20 21 22 ... 65