Welcome To Snipplr


Everyone's Recent Snippets Tagged javascript



/* author : MD. MUZAHIDUL ISLAM ([email protected]) * file name : cascade-load.js * This segment of code uses jQuery(jquery-1.7.2.js) that helps to load cascade data from sever. * To use this code, 'div' element should contains a 'select' h...
0 140 posted 6 years ago by muzahidict
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 348 posted 6 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 592 posted 6 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 142 posted 6 years ago by apphp-snippets
Dynamic equal height columns that account for padding and borders.
1 143 posted 6 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 91 posted 6 years ago by camdagr8
Function enables the reading of url appended variables. See URL for more information.
0 146 posted 6 years ago by gromitski
Avoid history back when is pressed backspace key in number imput
0 89 posted 6 years ago by porquero
Extremely helpful to anyone who is looking to improve performance and follow best practices in HTML/CSS
1 259 posted 6 years ago by Rar
Track user interactions with html forms
1 168 posted 6 years ago by nicom
For example, in a button, in OnClientClick method, pass parameters for a javascript method.
0 300 posted 7 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 107 posted 7 years ago by apphp-snippets
How would you validate the number of days in a given month?
0 186 posted 7 years ago by satie83
Include any external text file within html; HTML, CSS and Javascript all work.
0 161 posted 7 years ago by nshakin
Self updating javascript copyright date
0 110 posted 7 years ago by nshakin
Works in SP2013 (and I believe 2010). Provides site collection URL without trailing "/"
0 127 posted 7 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 122 posted 7 years ago by SnipplrSlush
Show alternative views of your page, depending on a hashtag
0 98 posted 7 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 136 posted 7 years ago by jbernus
Assuming that by empty means "has no properties of its own"
0 125 posted 7 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 152 posted 7 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 136 posted 7 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 110 posted 7 years ago by redhatmatt
Checks if JQuery is loaded and then checks if loaded version of JQuery >= needed version
0 92 posted 7 years ago by lubosfonio
Used to stretch a video / image to fill a background without skewing. Attach to resize events
0 152 posted 7 years ago by rickygri
This is a simple fix for the iOS zoom bug that happens when changing screen orientations.
0 125 posted 7 years ago by bitsculptor
Use Javascript to check if JQuery is loaded properly in the browser
1 129 posted 7 years ago by nshakin
The following code fetches contents of each Title field from the list called "LandingMiddleLinks"
0 213 posted 7 years ago by rumremix
Use a regex to check the email address input
4 276 posted 7 years ago by dreamstarter
simple code of using Ajax by JavaScript or jQuery
0 160 posted 7 years ago by codingforever99