Welcome To Snipplr


Everyone's Recent JavaScript Snippets



1 ... 4 5 6 7 8 ... 67
Useful trick from css tricks blog at http://css-tricks.com/snippets/jquery/fixing-ie-z-index/
0 403 posted 8 years ago by rumremix
A simple template for a JavaScript function which allows for an arbitrary number of named arguments to be passed in. This is achieved by passing a single object as an argument with each of the 'real' arguments being a key/value pair. In this way argu...
0 522 posted 8 years ago by davidwaterston
Logs offline application cache states. Swaps cache if updated version is available.
0 283 posted 8 years ago by zfisic
Basic information on JavaScript from CodeAcademy.com's JavaScript track
0 339 posted 8 years ago by denakitan
Clear text input when the user selects it (on focus)
0 321 posted 8 years ago by rickygri
JavaScript is the only option, if you want to have the ability to clear all form fields. Yes, HTML form has Reset method, but if the form has initial values, then Reset will return the form to the initial state instead of clear input fields. This exa...
0 378 posted 8 years ago by laxman2021
For those moments of weakness when .replace() looks like a good idea...
0 386 posted 8 years ago by inreflection7
Ask the user with a confirmation dialog if the link should be followed or not.
0 277 posted 8 years ago by gummiost
The marquee will stop when you hover the cursor over it. It will restart when you move the cursor away from it.
1 368 posted 8 years ago by o0110o
generischer Handler für die Eventausgabe in der Konsole....
0 338 posted 8 years ago by dejot
jsHint happy class template for javascript
1 381 posted 8 years ago by XtreamIT
**Simple JavaScript Quiz** Edit the main quiz array with your own questions, then publish. Since it's an entire HTML file, it's best to save this file on a server and embed it as needed using an iframe tag.
0 1138 posted 9 years ago by jrue
Set the desired date within the function. Make some images and label them "1.jpg, 2.jpg, 3.jpg, etc...". That's how it's done.
1 337 posted 9 years ago by o0110o
javascript arrays up and down
2 300 posted 9 years ago by kutyadog
Any valid json object will be recursively traversed building a nested unordered list of its properties and their values. This example parses the json entered in the text area into an object that is passed to the json_tree() function. I use the twit...
0 454 posted 9 years ago by halk
Emulates the StringBuilder() function found in .NET Languages
0 236 posted 9 years ago by jswaringen
this is how to instantiate a dropdown shadow using js code, works in IE10 and windows store apps. Important for when you want use templates.
0 521 posted 9 years ago by Syllogism
Para limpiar o borrar una parte especifica de nuestro canvas podemos usar la función clearRect()
0 577 posted 9 years ago by maiden
Allows you to click a given checkbox X, then shift click another checkbox Y. All checkboxes between X and Y will be checked or unchecked based on the state of checkbox Y. i.e. if you're unchecking Y all boxes between X and Y will also be unchecked.
1 511 posted 9 years ago by ReedD19
Obtener el último video favorito de un usuario de youtube
0 230 posted 9 years ago by alexdw
Simple code example that allows you to pull a time stamp / timestamp to attach to end of URL for GET POST calls
0 419 posted 9 years ago by kutyadog
Code from https://snipt.net/geekyjohn/get-url-param/ updated so that most jslint issues are resolved, and updated the return to use a guard condition instead of a separate if statement.
1 536 posted 9 years ago by pmw57
Standard hasClass, addClass, and removeClass functions, reworked so that jsLint is happier about them, and fixed the removeClass function so that things are trimmed after removing a class name.
2 502 posted 9 years ago by pmw57
Simulate the $_GET array from php in javascript to get url parameters this way: url= http://localhost/?var1=example $_GET['var1'] will return "example" Just copy and paste the code.
2 463 posted 9 years ago by sergiazow
Javascript Basic Date Formatter
0 813 posted 9 years ago by samsonl
Comprueba la existencia de una cadena de texto en un input con javascript. (LA impresion del input está en CAKEPHP)
0 289 posted 9 years ago by serialk89
Simply changes the name attribute on input elements when the page is loaded.
0 293 posted 9 years ago by stevielamb83
Original by dvdrtrgn
0 454 posted 9 years ago by guilhermehn
How does it work? This code checks/unchecks all checkboxes within the same fieldset. Simple and semantic. HTML Setup Add checkboxes however you like, just make sure they are within the same fieldset. <fieldset> <!--> <div><input>...
1 264 posted 9 years ago by dnnsldr
Here’s a handy bit of code that I use quite regularly, its particularly useful if your getting a response message from a form to notify the user that there data was sent, or comunicate an error and you want to fade the message out after a set time.
1 403 posted 9 years ago by dnnsldr
1 ... 4 5 6 7 8 ... 67