Welcome To Snipplr


Everyone's Recent JavaScript Snippets



How to download file from file cabinet
0 1041 posted 9 years ago by NSahu
Simulates a click on a page with the name you put in the parameter in the onclick function.
1 1041 posted 10 years ago by Reiff
Simple functions to add, fetch or delete cookies in the browser via JavaScript.
0 609 posted 10 years ago by deanhouseholder
- I have not tested on android - This is not animated as I did not need it for my needs. To make it animated, look at the second to last line in the function `layer3.transform = Ti.UI.create2DMatrix().rotate(angle);` You should be able to animate th...
0 830 posted 10 years ago by rondog
Javascript to open a URL in a new window without triggering a browser's pop-up blocker. (May not work in callbacks, but not sure why.)
1 1194 posted 10 years ago by eklemen
Sometimes you need the page dynamically changes a texbox with a dropdown box. On the example below we show you how to perform this work. The first way demonstrates how to do this with remove() and append() jQuery methods and the second shows how to p...
1 4280 posted 10 years ago by apphp-snippets
Class member encapsulation in JavaScript is very important thing and may be implemented with easy. To define private property or method just use var before the definition or this., if you need to give a public access to property or method.
0 747 posted 10 years ago by apphp-snippets
In this article I will show you how to use AngularJS and Laravel Blade together. People who have been using AngularJS for a while may know of this solution. However if you are just getting started or have never used Angular with a templating engine...
0 874 posted 10 years ago by CreativePunch
Add / Remove comma for number in the thousands. Ex: 1,000 Useful for grabbing input values to format then display, remove the comma and convert back to number to do math.
0 1464 posted 10 years ago by supawaza
Dynamic equal height columns that account for padding and borders.
1 704 posted 10 years ago by o0110o
Calculates the time in hh:mm:ss between two dates Usage: var past = new Date('1/1/2013'); var now = new Date(); var lapsed = past.lapsed(now);
0 594 posted 10 years ago by camdagr8
Function enables the reading of url appended variables. See URL for more information.
0 708 posted 10 years ago by gromitski
Uses the object prototype to extend data. Instantiate as an object and use as specified below (bottom of the code)
0 707 posted 10 years ago by rickygri
A quick function that makes it easy to convert an integer into a number string with commas inserted.
0 631 posted 10 years ago by uberdragon
Usage: var a = ['a','a','a']; var b = a.AllValuesSame(): //true var a ['1','1','2']; var b = a.AllValuesSame(); //false
0 2035 posted 10 years ago by uberdragon
This will calculate the ticks for google charts so that you can have a chart with a defined height, and still represent large data ranges with out all the vertical information getting bunched up together.
0 564 posted 10 years ago by uberdragon
I don't really know how other people do this kind of thing, but this was my take.
0 728 posted 10 years ago by domramirez
You can put the user's cursor inside a text box or put focus on select box as soon as your page is loaded. This helps ensure that visitors do not 'overlook' an important form item on your site and this snippet only uses one line of code!
0 612 posted 10 years ago by apphp-snippets
Nowadays majority of sites uses the jQuery JavaScript library. A lot of them also make use of Google's hosted version of the library from some reasons: faster loading, better cross site caching etc. However, what if there is ever a problem and jQuery...
0 513 posted 10 years ago by apphp-snippets
More info: http://stackoverflow.com/questions/10908562/is-there-something-similar-to-window-load-for-executing-a-function-after
0 795 posted 10 years ago by rickygri
* Used to create markers based solely on latitude and longitude * Replace the existing mainPoints() function in map-functions.js
0 673 posted 10 years ago by tymartist
<script></script>
0 708 posted 10 years ago by thesmu
$(document).ready(function() { // Handler for .ready() called. });
0 803 posted 10 years ago by thesmu
How would you validate the number of days in a given month?
0 978 posted 10 years ago by satie83
Include any external text file within html; HTML, CSS and Javascript all work.
0 725 posted 10 years ago by nshakin
Self updating javascript copyright date
0 610 posted 10 years ago by nshakin
Works in SP2013 (and I believe 2010). Provides site collection URL without trailing "/"
0 751 posted 10 years ago by rumremix
jQuery Validate is used in ASP.Net MVC 4. As it is checking only en-US as a default you may have problems with different cultures for decimal inputs and dates (I had to try for minutes to find a accepted date format. I don't want to see how my custom...
0 701 posted 10 years ago by SnipplrSlush
Show alternative views of your page, depending on a hashtag
0 533 posted 10 years ago by jbernus
This handy tool takes raw CSS and finds all relative URLs for background images and injects the absolute path. After which all the background images are displayed on the page. This is useful if you need a quick way to save all background images at on...
0 698 posted 10 years ago by pussard