SEO'BrienSearch and online marketing with Paul O'Brien |
|
| ||||
| Sign up for a feed or Subscribe by Email | ||||||
SEO'BrienSearch and online marketing with Paul O'Brien |
|
| ||||
| Sign up for a feed or Subscribe by Email | ||||||
// Wrap the code in a function so all variables are local (function( doc ) { // Base URLs for the calendar components var imgBase = 'http://www.zvents.com/images/';var scriptBase = 'http://www.zvents.com/misc/netcal/89/';
// Load the full calendar, or write out a fallback version // for non-JavaScript and older browsers loadFullCalendar() || writeBasicCalendar();
// If we have a compatible browser, add a SCRIPT // element to load host.js, and write a DIV // container with a Loading... indicator function loadFullCalendar() {return compatibleBrowser() &&addScript() &&writeContainer();}
// The dynamic script element will load in any // browser that supports a modern DOM, except // Konqueror, MSIE 5.x, and Safari versions // prior to 2.0.2 (WebKit build 416). function compatibleBrowser() {if( ! doc.getElementsByTagName ||! doc.createElement )return false;var ua = navigator.userAgent;if( ua.match('Konqueror|MSIE 5') )return false;var safari = ua.match('WebKit/([0-9]+)’);if( safari && +safari[1] < 416 )return false;return true;}
// Add a SCRIPT element to the document to load host.js function addScript() {var s = document.createElement( 'script' );s.type = 'text/javascript'; s.src = scriptBase + 'host.js';var h = doc.getElementsByTagName('head');return h && h[0] && h[0].appendChild( s );}
// Write a container DIV to the document with // a Loading... indicator. // Customize this freely as long as you keep // the outermost DIV. function writeContainer() {var ellipsis = '...'; // '…';doc.write('
‘ +’‘ +’Loading calendar’ + ellipsis + ‘‘ +’‘);return true;}
// Load a basic fallback calendar for browsers that run
// JavaScript but cannot load the dynamic script
function writeBasicCalendar() {doc.write(’
Popularity: 1% [?]
|