Monthly Archives: November 2011
jQuery Mobile
http://www.youtube.com/watch?v=VY20Q6ON4QA
Let Google Host jQuery For You
This seems to me to be a worthwhile approach to adopt if you are serving pages including the excellent Javascript library jQuery. I have learned something today – that an URL beginning with // is valid, legal, and useful. STUFF … Continue reading
JavaScript Coding Snippets
//String.prototype.trim = function() { // return this.replace(/^\s+|\s+$/g,””); //}; // //function showTruth(b) { // return (b)? ‘true’ : ‘false’; //} // //function isInClass(obj,theClass) { // if (obj.className) { // var arrayOfClasses = obj.className.split(‘ ‘); // for (var i = 0; i … Continue reading
JavaScript onload Chained Functions
// W I N D O W . O N L O A D //function addLoadEvent(func) { // var oldonload = window.onload; // if (typeof window.onload != ‘function’) { // window.onload = func; // } else { // window.onload = … Continue reading
JavaScript – What they call “Memoize”
var OBJECT_REF_CACHE = {}; // shorten typing and cache refs (see getById()) //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ function getById(id) { // shorten and memoize if (!OBJECT_REF_CACHE[id]) { OBJECT_REF_CACHE[id] = document.getElementById(id); } return OBJECT_REF_CACHE[id]; }
Apple some standard icons
http://didos-blog.blogspot.com/2011/03/uibarbuttonsystemitem-overview.html UIBarButtonSystemItemAction Constants UIBarButtonSystemItemDone The system Done button. Localized. Available in iOS 2.0 and later. UIBarButtonSystemItemCancel The system Cancel button. Localized. Available in iOS 2.0 and later. UIBarButtonSystemItemEdit The system Edit button. Localized. Available in iOS 2.0 and later. UIBarButtonSystemItemSave … Continue reading