Welcome To Snipplr


Everyone's Recent Snippets Tagged javascript



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 1212 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 4322 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 757 posted 10 years ago by apphp-snippets
Dynamic equal height columns that account for padding and borders.
1 714 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 605 posted 10 years ago by camdagr8
Function enables the reading of url appended variables. See URL for more information.
0 724 posted 10 years ago by gromitski
Avoid history back when is pressed backspace key in number imput
0 563 posted 10 years ago by porquero
Extremely helpful to anyone who is looking to improve performance and follow best practices in HTML/CSS
2 1107 posted 10 years ago by Rar
Track user interactions with html forms
1 875 posted 10 years ago by nicom
For example, in a button, in OnClientClick method, pass parameters for a javascript method.
0 1506 posted 10 years ago by keidash
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 627 posted 10 years ago by apphp-snippets
How would you validate the number of days in a given month?
0 1005 posted 10 years ago by satie83
Include any external text file within html; HTML, CSS and Javascript all work.
0 737 posted 10 years ago by nshakin
Self updating javascript copyright date
0 618 posted 10 years ago by nshakin
Works in SP2013 (and I believe 2010). Provides site collection URL without trailing "/"
0 767 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 720 posted 10 years ago by SnipplrSlush
Show alternative views of your page, depending on a hashtag
0 546 posted 10 years ago by jbernus
For side by side ULs that become too wide on small screens/devices. The following script let you merge or unmerge ULs depending on the size of the screen/device. Works with jQuery
0 689 posted 10 years ago by jbernus
Assuming that by empty means "has no properties of its own"
0 694 posted 10 years ago by satie83
This is a really basic skeleton template for jQuery plugins. It provides a callback function which can be called anywhere in your plugin with base.success(); This will return the current element, but you can pass anything you like back by changing th...
0 786 posted 10 years ago by rickygri
Configure settings for all external links on your site. Features: * Open external links in new window or tab * Add "nofollow" * Set link title * Set link icon * Set classes (for your own styling) * Set no-icon class * SEO friendly
0 874 posted 10 years ago by freelancephp
It currently uses redis as a store for the data. The url's are pretty long since it's all base64 encoded data and the images are returned as base64 encoded PNG's but that can be solved pretty easily. This could be used a service for something kind of...
0 635 posted 10 years ago by redhatmatt
Checks if JQuery is loaded and then checks if loaded version of JQuery >= needed version
0 507 posted 10 years ago by lubosfonio
Used to stretch a video / image to fill a background without skewing. Attach to resize events
0 772 posted 10 years ago by rickygri
This is a simple fix for the iOS zoom bug that happens when changing screen orientations.
0 707 posted 10 years ago by bitsculptor
Use Javascript to check if JQuery is loaded properly in the browser
1 707 posted 10 years ago by nshakin
The following code fetches contents of each Title field from the list called "LandingMiddleLinks"
0 1182 posted 10 years ago by rumremix
Use a regex to check the email address input
4 1043 posted 11 years ago by dreamstarter
simple code of using Ajax by JavaScript or jQuery
0 871 posted 11 years ago by codingforever99
The use of dynamic data acquisition on modern web sites and in a lot of intranet applications, sometimes means we have to build structures dynamically as data comes in from a feed or AJAX operations. The problem is not with the data, but rather that...
0 648 posted 11 years ago by COBOLdinosaur