September 30, 2008 at 12:03 am · Filed under Mobile, Programming
I’ve been working on a mobile version of the (dutch) translation website I founded. Apart from releasing the mobile site itself, it’s of course also important to make people aware of the existence of it. That’s exactly the reason why I started looking for a script that performs mobile device detection. The aim of such a script is to detect who visits the www-version of my website with a mobile device and automatically redirect those visitors to the mobile site.
Within a couple of minutes I already found a couple of php-scripts that perform the trick. After reading through the code and checking some comments on blogs I ended up with two candidates:
1) A script by Andy Moore on mobiForge
2) A script by Russell Beattie
That left me with the next dillema, which one to pick?
Read the rest of this entry »
March 26, 2007 at 6:15 pm · Filed under Programming
I always thought that only Microsoft Internet Explorer supported a ‘bookmark this site’ functionality. By doing some research on the web I found a few code snippets that did the trick for other browsers as well. I compiled these scripts together in the following bookmarkthis(title, url) function. It’s completely cross-browser (compatible with IE4+, Firefox 1.x+ and Opera7+). Have fun with it!
function bookmarkthis(title,url) {
if (window.sidebar) { // firefox
window.sidebar.addPanel(title, url, "");
} else if (document.all) { // IE
window.external.AddFavorite(url, title);
} else if (window.opera && window.print) { // opera
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
}
}