Welcome To Snipplr
Everyone's Recent JavaScript Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Simulates a click on a page with the name you put in the parameter in the onclick function.
1
1288
posted 10 years ago by Reiff
Simple functions to add, fetch or delete cookies in the browser via JavaScript.
0
774
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
1064
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
1450
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
4894
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
989
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
1111
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
1687
posted 10 years ago by supawaza
Dynamic equal height columns that account for padding and borders.
1
935
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
801
posted 11 years ago by camdagr8
Function enables the reading of url appended variables. See URL for more information.
0
931
posted 11 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
867
posted 11 years ago by rickygri
A quick function that makes it easy to convert an integer into a number string with commas inserted.
0
815
posted 11 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
2535
posted 11 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
760
posted 11 years ago by uberdragon
I don't really know how other people do this kind of thing, but this was my take.
0
937
posted 11 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
806
posted 11 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
699
posted 11 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
1001
posted 11 years ago by rickygri
* Used to create markers based solely on latitude and longitude
* Replace the existing mainPoints() function in map-functions.js
0
869
posted 11 years ago by tymartist
$(document).ready(function() {
// Handler for .ready() called.
});
0
1060
posted 11 years ago by thesmu
Include any external text file within html; HTML, CSS and Javascript all work.
0
940
posted 11 years ago by nshakin
Works in SP2013 (and I believe 2010). Provides site collection URL without trailing "/"
0
971
posted 11 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
888
posted 11 years ago by SnipplrSlush
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
883
posted 11 years ago by pussard