Welcome To Snipplr


Everyone's Recent JavaScript Snippets Tagged javascript



1 ... 5 6 7 8 9 ... 33
This bit of jquery will take whatever you give it in the selector (which should be a valid jquery selector of any kind) and add or remove additional classas as appropriate based on width. The width and style names are all determined by the last i...
0 694 posted 12 years ago by FatFolderDesigner
Developing a form where I had several date and time fields, I came with a jQuery multiselector where I need to get, through the name attribute, if it was a date or time field. So far, jQuery does not have a boolean method to check if an attribute of...
0 692 posted 12 years ago by betacar
Why do this? =========== *hopefully* this will cause the page to refresh and provide a stop button in the future. The idea is to use it while developing in a text editor, as in Vim or its ilk, and not have to alt+tab all the _*flipping*_ time. F...
0 554 posted 12 years ago by inreflection7
found the solution here: http://stackoverflow.com/questions/2790001/fixing-javascript-array-functions-in-internet-explorer-indexof-foreach-etc
0 484 posted 12 years ago by pixelatorz
Pass variables into javascript files using query strings, and return them using getJSvars() Example //HTML <script> //return the value of "foo" getJSvars('filename.js', 'foo');
0 675 posted 12 years ago by DenoteIt
How to know if an element exists in JS (and jQuery).
0 608 posted 12 years ago by cesarkohl
Alterar Background randomicamente.
0 354 posted 12 years ago by Jotape
This requires my [date formatting script](http://snipplr.com/view/54806/javascript-date-formatting/). (date).toISO() converts the Date object to an ISO 8601 string Date.fromISO() converts an ISO 8601 string to a Date object
0 823 posted 12 years ago by wizard04
Code obtained from a [stackoverflow question](http://stackoverflow.com/questions/4672279/bresenham-algorithm-in-javascript). This is a javascript implementation of the [Bresenham line algorithm](http://en.wikipedia.org/wiki/Bresenham's_line_algorithm...
0 942 posted 12 years ago by nefd
Restricts the characters that are entered into a textbox. Also limits the length of the value to 5.
0 598 posted 12 years ago by Krummelz
Check if user has intruded a real email address. Return true (real email) or false (fake email). Arguments: Element from a form. From book Dom Scripting by Jeremy Keith
0 918 posted 12 years ago by alberomo
Arguments: Element from a form. Take that element and checks if is filled. If not, returns false. If is filled, returns true. From book Dom Scripting by Jeremy Keith
0 859 posted 12 years ago by alberomo
A JS function that put the focus in the form field associated to a label element whenever is clicked. The for atributte of the label element must match the id attribute of the associated form field. It takes no arguments. From book Dom Scripting by...
0 544 posted 12 years ago by alberomo
JS Function that style sibling elements of a given tag. Arguments: tag of the element We want siblings to style and name of the class we want to add. It needs the class to be styled (using CSS). It uses getNextElement function and addClass functions....
0 366 posted 12 years ago by alberomo
A JS function that makes bold the text of table rows ("tr" elements) when you "mouseover" them. It takes no arguments. From book Dom Scripting by Jeremy Keith.
0 346 posted 12 years ago by alberomo
A JS function that stripes the tables ("table" elements) of a document. It takes no arguments. Add a new class ("odd") to the odd rows that needs to be styled using CSS. Use addClass function. From book Dom Scripting by Jeremy Keith.
0 408 posted 12 years ago by alberomo
A JS function that returns the next element of a node. Argument: The node you want to know next element. From book Dom Scripting by Jeremy Keith.
0 442 posted 12 years ago by alberomo
JS function that takes the accesskey attribute of the links of the document and display them at the end of the document. Takes no arguments. From book Dom Scripting by Jeremy Keith.
0 352 posted 12 years ago by alberomo
JS function that add a link included in the cite attribute of the blackquote HTML element as sup element close to the blackquote. Takes no argument. From book Dom Scripting by Jeremy Keith.
0 365 posted 12 years ago by alberomo
This is just a simple explanation of how to use the HTML5 local storage in javascript. The link has a more thorough explanation and an example for those interested. The examples to save, retrive, and clear are marked below.
0 593 posted 12 years ago by FatFolderDesigner
0 594 posted 12 years ago by BebenKoben
This is a simple example of the google maps javascript API v3. If you want a map with a marker this is the minimum you need to do to get it done. Theres more talk about how it's all set up, and how to use the other static image map as well at the lin...
1 770 posted 12 years ago by FatFolderDesigner
1 ... 5 6 7 8 9 ... 33