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 715 posted 13 years ago by kevinlearynet
0 628 posted 13 years ago by CJness
Example: April 5th, 2011
0 797 posted 13 years ago by trusktr
0 634 posted 13 years ago by anagai
0 908 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 803 posted 13 years ago by alvincrespo
Window.onload chaining using Namespaces.
0 566 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 2448 posted 13 years ago by mooparmghor
Link body class names to trigger javascript. It requires jQuery.
0 878 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 1352 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 709 posted 13 years ago by prwhitehead
0 644 posted 13 years ago by madr
Brilliant solution using Object.prototype.toString() Test cases included (commented out)
0 742 posted 13 years ago by wizard04
Enhanced cross-browser event handling
0 956 posted 13 years ago by wizard04
Returns an object with the `event.button` values of both the W3C and Microsoft models.
0 892 posted 13 years ago by wizard04
These functions allow you to set a handler for a mouseleave/enter event.
0 812 posted 13 years ago by wizard04
if you need ecmascript 5 functions then use underscore.js
0 810 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 881 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 843 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 719 posted 13 years ago by jasonseney
Activation: con Scope: source.js, source.js.jquery
0 794 posted 13 years ago by divtagged
This is implementation of pseudocode given in quicksort wikipedia page. Did it just for fun :)
0 696 posted 13 years ago by naren1012
Valiodate a form with jQuery.Validate and submit it with jQuery.form
1 749 posted 13 years ago by marzsman
1 ... 11 12 13 14 15 ... 46