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 1300 posted 14 years ago by kevinlearynet
0 1287 posted 14 years ago by CJness
Example: April 5th, 2011
0 1442 posted 15 years ago by trusktr
0 1280 posted 15 years ago by anagai
0 1618 posted 15 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 1458 posted 15 years ago by alvincrespo
Window.onload chaining using Namespaces.
0 1119 posted 15 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 3471 posted 15 years ago by mooparmghor
Link body class names to trigger javascript. It requires jQuery.
0 1802 posted 15 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 2443 posted 15 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 1271 posted 15 years ago by prwhitehead
0 1224 posted 15 years ago by madr
Brilliant solution using Object.prototype.toString() Test cases included (commented out)
0 1319 posted 15 years ago by wizard04
Enhanced cross-browser event handling
0 1806 posted 15 years ago by wizard04
Returns an object with the `event.button` values of both the W3C and Microsoft models.
0 1710 posted 15 years ago by wizard04
These functions allow you to set a handler for a mouseleave/enter event.
0 1502 posted 15 years ago by wizard04
if you need ecmascript 5 functions then use underscore.js
0 1560 posted 15 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 1849 posted 15 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 1556 posted 15 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 1327 posted 15 years ago by jasonseney
Activation: con Scope: source.js, source.js.jquery
0 1403 posted 15 years ago by divtagged
This is implementation of pseudocode given in quicksort wikipedia page. Did it just for fun :)
0 1439 posted 15 years ago by naren1012
Valiodate a form with jQuery.Validate and submit it with jQuery.form
1 1333 posted 15 years ago by marzsman
1 ... 11 12 13 14 15 ... 46