Avoid console errors in browsers that lack a console.
Excerpted from HTML5 boilerplate:
| "use strict"; | |
| /** | |
| * jQuery.browser.mobile (http://detectmobilebrowser.com/) | |
| **/ | |
| var $ = jQuery; | |
| (function(a) { | |
| ($.browser = $.browser || {}).mobile = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp |
| function parseURL(url) { | |
| var parser = document.createElement('a'), | |
| searchObject = {}, | |
| queries, split, i; | |
| // Let the browser do the work | |
| parser.href = url; | |
| // Convert query string to object |
| /* | |
| * Copyright (C) 2004 Baron Schwartz <baron at sequent dot org> | |
| * | |
| * This program is free software; you can redistribute it and/or modify it | |
| * under the terms of the GNU Lesser General Public License as published by the | |
| * Free Software Foundation, version 2.1. | |
| * | |
| * This program is distributed in the hope that it will be useful, but WITHOUT | |
| * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | |
| * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
| (function($) { | |
| $.extend({ | |
| smoothBrowserScroll: function() { | |
| // Scroll Variables (tweakable) | |
| var defaultOptions = { | |
| // Scrolling Core | |
| frameRate : 150, // [Hz] |
| /* | |
| Plugin Name: BrowserSelector | |
| Written by: Crivos - (http://www.crivos.com) | |
| Version: 0.1 | |
| */ | |
| (function($) { | |
| $.extend({ | |
| browserSelector: function() { |
| /*! | |
| * jQuery JavaScript Library v1.11.0pre | |
| * http://jquery.com/ | |
| * | |
| * Includes Sizzle.js | |
| * http://sizzlejs.com/ | |
| * | |
| * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors | |
| * Released under the MIT license | |
| * http://jquery.org/license |
| <style> | |
| /* from http://www.mobilexweb.com/blog/ios-5-1-new-ipad-web-developers */ | |
| @media screen and (-webkit-device-pixel-ratio: 2) { | |
| /* retina display */ | |
| } | |
| </style> | |
| <script> | |
| // from https://developer.mozilla.org/en/DOM/window.matchMedia | |
| if (window.matchMedia("(-webkit-device-pixel-ratio: 2)").matches) { |
Avoid console errors in browsers that lack a console.
Excerpted from HTML5 boilerplate:
| /* Vietnamese localization for the jQuery UI date picker plugin. */ | |
| /* Written by Tien Do ([email protected]) */ | |
| jQuery(function ($) | |
| { | |
| $.datepicker.regional["vi-VN"] = | |
| { | |
| closeText: "Đóng", | |
| prevText: "Trước", | |
| nextText: "Sau", |
| // Module dependencies | |
| var express = require('express'), | |
| mysql = require('mysql'); | |
| // Application initialization | |
| var connection = mysql.createConnection({ | |
| host : 'localhost', | |
| user : 'root', |