Welcome To Snipplr


Everyone's Recent Snippets Tagged javascript



1 2 3 4 5 6 ... 46
This simple scripts show a possibility to call a JavaScript function that retrieves a variable passed from drop down box as a parameter and then the JavaScript redirects the browser to the variable that was passed to it.
0 557 posted 9 years ago by apphp-snippets
This script informs your visitor that a given page may be reached only from the page that you specify. Paste this code before the ending <head> tag on the page:
1 506 posted 9 years ago by apphp-snippets
One of the important things about user input is to verify that the user has supplied the email that you have requested. The function below allows you to verify email address with easy.
1 644 posted 9 years ago by apphp-snippets
The function that closes window is very useful when you use a pop-up window on your page, because it allows the visitor to easily close the window. You can also do it several ways: to use a button, a text link or make the window closes automatically...
1 503 posted 9 years ago by apphp-snippets
You may perform this work with two ways: pass it directly like described in sample #1 or use an anonymous function like its shown in sample #2.
0 768 posted 9 years ago by apphp-snippets
This function allows you to pass two variables that represent ID of two elements on your page. What you click on one of them it hide it and shows another one.
1 426 posted 9 years ago by apphp-snippets
myEls should be the selector statement for whatever elements you want to effect. The example wraps every 3.
1 752 posted 9 years ago by adambundy
based on the NappScrollViewExtended module (it is good but couse my app some problem)
0 461 posted 9 years ago by boardmain
Returns the differencia in days between tw dates
0 620 posted 9 years ago by agarcim
Functions to add, get y remove CSS rules
0 497 posted 9 years ago by agarcim
Con este esquema puedes crear objetos instanciables en Javascript usando jQuery. Su uso es muy simple, sólo debes copiar el siguiente código y cambiar las variables que están en mayúsculas.
0 441 posted 9 years ago by porquero
This is a more precise version of the native setTimeout(). It uses the same parameters as setTimeout, but adds a third parameter "resolution" which defines how often (in ms) to check for the time that passed. // alert after 5 seconds with an i...
2 366 posted 9 years ago by McSodbrenner
Con ese codigo pueden agregar tildes y ñ en los alert o en las funciones de facebook
0 455 posted 9 years ago by serialk89
Sometimes you have some information on your page and your visitors might want to copy it. The easiest way is to provide a mechanism that allows them to simply click a button to do so. You have to paste this code into the head of your web page:
0 562 posted 9 years ago by apphp-snippets
This script informs your visitor that a given page may be reached only from the page that you specify. Paste this code before the ending <head> tag on the page:
0 563 posted 9 years ago by apphp-snippets
This will reset the tabindex of all input fields on a form after page load
0 828 posted 9 years ago by bitsculptor
removes scrollbars and expand to content height.
0 462 posted 10 years ago by bonalepo
Code snippets from the x-editable source code
0 547 posted 10 years ago by steho
The following function loads all browser-cookies into an associative array with the cookie name as the index and the cookie value as the value
0 429 posted 10 years ago by satie83
Javascript which converts a Date object into an ISO 8601 formatted string - 'YYYY-MM-DDTHH:mm:ss.sssZ' - with a fallback for when the function 'toISOString' doesn't exist (e.g. IE 8 or less). Usage: var now = new Date; console.log(now.toISOStrin...
0 1012 posted 10 years ago by davidwaterston
Browser detection before sending any resources to the client.
0 676 posted 10 years ago by chrisaiv
Returns true if the string 'value' is a valid date.
0 1023 posted 10 years ago by agarcim
javascript image uplaod
0 1521 posted 10 years ago by laxman2021
message alert, javascript alert
0 430 posted 10 years ago by laxman2021
This is a very basic wrapper for querySelectorAll. Just add prototypes and whatever else you need.
1 461 posted 10 years ago by o0110o
jQuery
0 359 posted 10 years ago by msstar
With this statement you can reload a page, this will also reset any forms on the page.
1 381 posted 10 years ago by seloh77
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 836 posted 10 years ago by davidwaterston
Basic information on JavaScript from CodeAcademy.com's JavaScript track
0 490 posted 10 years ago by denakitan
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 555 posted 10 years ago by laxman2021
1 2 3 4 5 6 ... 46