Posts tagged with widgets

Vodafone Mobile Widget Camp

April 21st, 2009

I’m one of the organizers of the Mobile Widget Camp on May 2. The free event is taking place at Pakhuis de Zwijger, Amsterdam. Daniel Appelquist (Vodafone Betavine), Peter-Paul Koch (Quirksmode), and Elliot Kember (Carsonified) are among the speakers in the morning, so you’re guaranteed to get a great introduction to Vodafone/Opera widgets. Beside these speakers there will be hands-on workshops and time to code your own mobile widgets. Anyone with basic HTML, CSS and Javascript knowledge can make a mobile widget, so make sure to come and help will be available from experts to help you coding. Read more about Mobile Widget Camp on the website.

Loading Javascript Libraries When Needed

June 23rd, 2008

Here is a nice little Javascript function to load some Javascript libraries:

function includeLibs()
{
var libs = [{object: 'Prototype', src: 'http://www.mobypicture.com/slideshow/prototype.js'}, {object: 'Lightbox', src: 'http://www.mobypicture.com/slideshow/lightbox.js'}];
for (var k = 0; k < libs.length; k++)
{
try
{
var obj = eval(libs[k].object);
}
catch (err)
{
var obj = false;
}
if (obj == false)
{
var newjs=document.createElement('script');
newjs.type='text/javascript';
newjs.src=libs[k].src;
document.getElementsByTagName('head')[0].appendChild(newjs);
}
}
}

This is particularly useful if you’re writing a widget that requires external libraries but the user might already have them loaded, such as Prototype.