#Stay Standalone
A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.
// ---------------------------------------------------------- | |
// 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) {} |
// HOWTO: load LABjs itself dynamically! | |
// inline this code in your page to load LABjs itself dynamically, if you're so inclined. | |
(function (global, oDOC, handler) { | |
var head = oDOC.head || oDOC.getElementsByTagName("head"); | |
function LABjsLoaded() { | |
// do cool stuff with $LAB here | |
} |
// Original code from http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/ | |
var metas = document.getElementsByTagName('meta'); | |
var i; | |
if (navigator.userAgent.match(/iPhone/i)) { | |
for (i=0; i<metas.length; i++) { | |
if (metas[i].name == "viewport") { | |
metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0"; | |
} | |
} |
/* | |
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/ | |
* Better handling of scripts without supplied ids. | |
* | |
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function. | |
*/ | |
(function(doc, script) { | |
var js, | |
fjs = doc.getElementsByTagName(script)[0], |
#Stay Standalone
A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> | |
<title>Backbone.js example</title> | |
<link rel="stylesheet" type="text/css" href="css/sunny/jqueryui.min.css"/> | |
</head> | |
<body> | |
<!-- "slider" is a jquery slider --> | |
<div id="slider"></div> |
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
//John Resig's handy catch-all log (amended with my own linenumber add-on + new and improved CSS support for chrome!): | |
function trace() {//just cause I like "trace" better than his "log" | |
try { | |
var dA = navigator.userAgent.toLowerCase(), fF = dA.match(/(firefox)/); | |
//show linenumber in FireFox & Chrome | |
if(fF){var lnVal = 1;}else{var lnVal = 2;}//fireFox sorts Error stack differently | |
var linenumber = new Error().stack.split("\n")[lnVal], index = linenumber.indexOf("at "), clean = linenumber.slice(index+2, linenumber.length), cleaner = clean.split(":"); | |
console.log.apply(console, arguments); | |
if(fF){ | |
console.log("--------------------------------------------------------------- line:"+Array.prototype.slice.call(cleaner)[2]); |
var html = '<h1 class="nar">Narendra</div>'; | |
var css = '.nar { color: red; background: url("http://google.com/images/google_favicon_128.png") repeat scroll 0 0 transparent;}'; | |
var nodeWhereToAppend = document.body; | |
//var nodeWhereToAppend = document.getElementById("container"); | |
function CreateIframe(html, css, nodeWhereToAppend){ | |
var fragment = document.createDocumentFragment(); | |
var iframe = document.createElement('iframe'); | |
iframe.onload = function(){ | |
var doc = this.contentWindow.document; |
<?php | |
/** | |
* _s Theme Options | |
* | |
* @package _s | |
* @since _s 1.0 | |
*/ | |
/** | |
* Register the form setting for our _s_options array. |