Skip to content

Instantly share code, notes, and snippets.

@fektor
fektor / gist:3870816
Created October 11, 2012 07:40 — forked from bryanp/gist:1206611
Javascript: iPad Detection
function isiPad() {
return navigator.userAgent.match(/iPad/i) != null;
}
@fektor
fektor / gist:3803823
Created September 29, 2012 12:13 — forked from dn3hgh/gist:2780294
HTML: html5 structure
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>HTML5 Document</title>
</head>
<body>
<header>
<h1>Page Header</h1>
@fektor
fektor / ajaxify-html5.js
Created September 29, 2012 12:12 — forked from balupton/README.md
Ajaxify a Website with the HTML5 History API using History.js, jQuery and ScrollTo
// https://gist.github.com/854622
(function(window,undefined){
// Prepare our Variables
var
History = window.History,
$ = window.jQuery,
document = window.document;
// Check to see if History.js is enabled for our Browser
@fektor
fektor / ajaxify-html5.js
Created September 29, 2012 12:12 — forked from balupton/README.md
Ajaxify a Website with the HTML5 History API using History.js, jQuery and ScrollTo
// https://gist.github.com/854622
(function(window,undefined){
// Prepare our Variables
var
History = window.History,
$ = window.jQuery,
document = window.document;
// Check to see if History.js is enabled for our Browser
@fektor
fektor / navigator-ff-ie.js
Created September 25, 2012 12:38
Javascript: Browser detection
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
if(ieversion>=9) {
//IE9
} else
if(ieversion>=8) {
//IE8
} else
@fektor
fektor / gist:3781375
Created September 25, 2012 12:06 — forked from padolsey/gist:527683
Javascript: ie detection
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}