var divs = $("div");
var divs = document.querySelectorAll("div");
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs") | |
port = process.argv[2] || 8888, | |
mimeTypes = { | |
"html": "text/html", | |
"jpeg": "image/jpeg", | |
"jpg": "image/jpeg", | |
"png": "image/png", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Starting point: https://css-tricks.com/snippets/css/prevent-long-urls-from-breaking-out-of-container/ | |
If this is in a flex-item, make sure that element has a min-width set for IE support | |
(otherwise, IE/Edge will still break words, but infer that the content length is longer than it should be and possibly stretch the container larger than intended) | |
IE/Edge workds nicely with inline elements, until you have another inline element nested within it that needs to wrap/break. | |
IE/Edge's handling of block elements requires "break-all" functionality, which will break words unnecessarily. | |
*/ | |
selector { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "Alabama", | |
"abbreviation": "AL" | |
}, | |
{ | |
"name": "Alaska", | |
"abbreviation": "AK" | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CONVERT A STRING TO A VALID FILENAME | |
function CreateFileName(string){ | |
var str=Trim(string); | |
// replace invalid filename characters: /\:*?"<>| and whitespaces with underscores | |
str=ReReplace(str,"[*?\""]","","ALL"); | |
str=ReReplace(str,"\s","_","ALL"); | |
str=ReReplace(str,"[:<>|]","-","ALL"); | |
str=Replace(str,"\","_-_","ALL"); | |
str=Replace(str,"/","_-_","ALL"); | |
// leading period is also invalid for MACs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="date" name="inspectionStart" value="#Dateformat(somedate,"yyyy-mm-dd")#"> | |
<script> | |
$(document).ready(function () { | |
// If a browser doesn't support HTML5 date input types, then load a backup/polyfill | |
if(!Modernizr.inputtypes.date){ | |
// Convert the format from the HTML5 dateformat of yyyy-mm-dd to mm/dd/yyyy | |
$('input[type=date]').each(function(){ | |
var thisdate=$(this).val(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hide submit buttons once clicked to prevent double-clicks | |
$('button.btn').not('[type=reset]').bind( "click", preventdoubleclick ); | |
function preventdoubleclick() { | |
$('button.btn').hide(); | |
$(this).before('<button name="submitmsg" id="submitmsg_button" type="button" class="btn btn-primary" value="Please Wait...">Please Wait...</button>'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@font-face { | |
font-family: 'my-web-font'; | |
src: url('webfont.eot'); | |
src: url('webfont.eot?#iefix') format('embedded-opentype'), | |
url('webfont.woff') format('woff'), | |
url('webfont.ttf') format('truetype'), | |
url('webfont.svg#webfont') format('svg'); | |
font-weight: normal; | |
font-style: normal; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- Parse form fields of the same name as an array instead of a list, to avoid issues with commas | |
more info: http://www.stillnetstudios.com/cf-form-array-comma-workaround/ | |
---> | |
<cffunction name="FormFieldAsArray" returntype="array" output="false" hint="Returns a Form/URL variable as an array."> | |
<cfargument name="fieldName" required="true" type="string" hint="Name of the Form or URL field" /> | |
<cfset var tmpPartsArray = Form.getPartsArray() /> | |
<cfset var returnArray = arrayNew(1) /> | |
<cfset var tmpPart = 0 /> | |
<cfset var tmpValueArray = "" > |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Textarea fields and "designmode" documents get spellchecked by default, but input type=text do not. | |
// https://developer.mozilla.org/en-US/docs/Web/HTML/Controlling_spell_checking_in_HTML_forms | |
// http://www.w3schools.com/tags/att_global_spellcheck.asp | |
// To force text inputs to be spellchecked, the you add the following the input tag: | |
// spellcheck="true" | |
// If we wanted to do this globally, we could also do this via a javascript: | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
$('input[value="text"]').attr('spellcheck','true'); |
NewerOlder