Welcome To Snipplr


Everyone's Recent Snippets Tagged javascript



1 ... 11 12 13 14 15 ... 46
Loading external scripts on demand the smart way with Head JS
0 675 posted 13 years ago by kevinlearynet
0 584 posted 13 years ago by CJness
Example: April 5th, 2011
0 742 posted 13 years ago by trusktr
0 583 posted 13 years ago by anagai
0 849 posted 13 years ago by dsoms
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 754 posted 13 years ago by alvincrespo
Window.onload chaining using Namespaces.
0 526 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 822 posted 13 years ago by cmndo
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 1281 posted 13 years ago by racl101
If your page has already sent headers to the browser you cant redirect with headers('Location:' . $url); But you can use the following:
0 671 posted 13 years ago by prwhitehead
0 595 posted 13 years ago by madr
Brilliant solution using Object.prototype.toString() Test cases included (commented out)
0 696 posted 13 years ago by wizard04
Enhanced cross-browser event handling
0 897 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 758 posted 13 years ago by wizard04
if you need ecmascript 5 functions then use underscore.js
0 763 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 832 posted 13 years ago by root_hacker
No need to create a seperate function for this one. Just one line to clear the default value on click and leave the value when it has been altered.
1 792 posted 13 years ago by dyteq
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 676 posted 13 years ago by jasonseney
Activation: con Scope: source.js, source.js.jquery
0 735 posted 13 years ago by divtagged
This is implementation of pseudocode given in quicksort wikipedia page. Did it just for fun :)
0 641 posted 13 years ago by naren1012
Valiodate a form with jQuery.Validate and submit it with jQuery.form
1 706 posted 13 years ago by marzsman
1 ... 11 12 13 14 15 ... 46