Welcome To Snipplr


Everyone's Recent JavaScript Snippets



1 ... 18 19 20 21 22 ... 65
Using an object as a simple switch.
0 717 posted 12 years ago by 1man
0 394 posted 12 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 593 posted 12 years ago by alvincrespo
Window.onload chaining using Namespaces.
0 392 posted 12 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 2074 posted 12 years ago by mooparmghor
Link body class names to trigger javascript. It requires jQuery.
0 630 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 497 posted 13 years ago by anagaiyahoocom
Put in head tag
0 610 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 1033 posted 13 years ago by racl101
Brilliant solution using Object.prototype.toString() Test cases included (commented out)
0 530 posted 13 years ago by wizard04
Enhanced cross-browser event handling
0 708 posted 13 years ago by wizard04
Returns an object with the `event.button` values of both the W3C and Microsoft models.
0 636 posted 13 years ago by wizard04
These functions allow you to set a handler for a mouseleave/enter event.
0 575 posted 13 years ago by wizard04
if you need ecmascript 5 functions then use underscore.js
0 603 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 663 posted 13 years ago by root_hacker
this is the way for toggling something on mouse hover in and out
0 810 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 521 posted 13 years ago by jasonseney
Activation: con Scope: source.js, source.js.jquery
0 566 posted 13 years ago by divtagged
0 399 posted 13 years ago by fadlee
This is implementation of pseudocode given in quicksort wikipedia page. Did it just for fun :)
0 471 posted 13 years ago by naren1012
1 ... 18 19 20 21 22 ... 65