// jQuery
$(document).ready(function() {
// code
})
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
*/ | |
$args = array( |
/** | |
* Disable and enable event on scroll begin and scroll end. | |
* @see http://www.thecssninja.com/javascript/pointer-events-60fps | |
*/ | |
var root = document.documentElement; | |
var timer; | |
window.addEventListener('scroll', function() { | |
// User scrolling so stop the timeout | |
clearTimeout(timer); |
<?php | |
$prev_post = get_previous_post(); | |
$id = $prev_post->ID; | |
$permalink = get_permalink( $id ); | |
$next_post = get_next_post(); | |
$nid = $next_post->ID; | |
$permalink = get_permalink($nid); | |
<figure class="quote"> | |
<blockquote>It is the unofficial force—the Baker Street irregulars.</blockquote> | |
</figure> |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>SKVariables</key> | |
<array> | |
<dict> | |
<key>enabled</key> | |
<true/> | |
<key>name</key> |
/* RESTORE DUMP */ | |
mysql -u #username# -p #database# < #dump_file# | |
/* END RESTORE DUMP */ | |
wget http://wordpress.org/latest.tar.gz | |
tar xfz latest.tar.gz | |
mv wordpress/* ./ |
*Device* *Portrait* *Landscape* *Device type* *Remarks* | |
Nexus 7 600 961 Tablet | |
iPad 2 768 768 Tablet iOS always reports the same, regardless of orientation. | |
Surface RT 1366 1024 Tablet | |
Galaxy Tab 2 1280 800 Tablet | |
Galaxy Nexus 360 598 Phone | |
iPhone 5 320 320 Phone iOS always reports the same, regardless of orientation. | |
Galaxy S3 mini 320 534 Phone Stock android browser reports 533, not 534 (Chrome). |
jQuery does good jobs when you're dealing with browser compatibility. But we're living in an age that fewer and fewer people use old-school browsers such as IE <= 7. With the growing of DOM APIs in modern browsers (including IE 8), most functions that jQuery provides are built-in natively.
When targeting only modern browsers, it is better to avoid using jQuery's backward-compatible features. Instead, use the native DOM API, which will make your web page run much faster than you might think (native C / C++ implementaion v.s. JavaScript).
If you're making a web page for iOS (e.g. UIWebView), you should use native DOM APIs because mobile Safari is not that old-school web browser; it supports lots of native DOM APIs.
If you're making a Chrome Extension, you should always use native APIs, not only because Chrome has almost the latest DOM APIs available, but this can also avoid performance issue and unnecessary memory occupation (each jQuery-driven extension needs a separate
// Avoid `console` errors in browsers that lack a console. | |
if (!(window.console && console.log)) { | |
(function() { | |
var noop = function() {}; | |
var methods = ['assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', 'markTimeline', 'profile', 'profileEnd', 'markTimeline', 'table', 'time', 'timeEnd', 'timeStamp', 'trace', 'warn']; | |
var length = methods.length; | |
var console = window.console = {}; | |
while (length--) { | |
console[methods[length]] = noop; | |
} |