Javascript MindFuck: Google Maps GeoCoder Callback with Parameters

If you have ever tried to geocode with google maps you have perhaps noticed that you can’t easy pass more data to the callback function. And geocoding on an array of addresses won’t work too, because you get always the result for the last entry of your array.

Read the rest of this entry »

PHP5 WebSocket Example – A Simple Chat

The classic example for websockets is a chat. This chat example has only 200 lines of code (excl. the Websocket class), is really easy to understand and customizable.

Read the rest of this entry »

Javascript Array Case-insensitive Sorting

easy if you know how …

 
myarray.sort(function(a, b){
    return a.toLowerCase() > b.toLowerCase();
});

Use Google Closure Compiler Local with PHP

In “Google Closure Compiler with PHP” i described how you can use the compiler online via http. Now i will show how you do it local on your server with the java command line application …

Read the rest of this entry »

HTML5 WebSockets Example

HTML5 WebSockets makes it possible to open a persistent connection to a server within a web-browser via javascript.

Read the rest of this entry »

SproutCore Erfinder eröffnet HTML5-Firma

Der SproutCore Erfinder Charles Jolley verlässt Apple und gründet ein Unternehmen das sich mit der Entwicklung neuer Rich-Web Applikationen auf HTML5-basis beschäftigen wird.

Read the rest of this entry »

Analytics Site Search Tracking

Selbst wenn man keine klassische Volltext-Suche auf der Seite hat kann man mit dem Site Search Tracking von Analytics arbeiten.
Read the rest of this entry »

Browser-History mit jQuery auslesen

Eine wirklich simple Idee … mittels der Farbunterscheidung zwischen “visited”- bzw. “nicht visited”-Links kann man die Browser-History eines Benutzers stehlen. Man braucht allerdings eine Linkliste die man vergleichen kann, also ist es kein richtiges stehlen. Im Detail funktioniert es so das man mittels Javascript Links erzeugt und vergleicht in welcher Farbe sie dargestellt werden. So kann man zB feststellen ob der Benutzer vorher schon bei den Konkurrenten vorbeigeschaut hat.

Mein Beispiel-Script kann man unter folgender Adresse finden:
http://bohuco.net/dev/history/

(via dicabrio)

Google Closure Compiler with PHP

Today Google released their new Closure Compiler, you can use it to optimize and minify your javascripts.

Read the rest of this entry »

iPhone Lagesensor via Javascript

Über den Lagesensor kann man ermitteln ob das iPhone gerade hochkant oder horizontal gehalten wird. Safari am iPhone besitzt dazu ein spezielles window-attribut. In window.orientation steht entweder 0 (für vertikal) oder +/-90 wenn das iPhone quer gehalten wird, je nachdem welche Richtung es gedreht wurde.

Um auf eine Änderung reagieren zu können gibt es den Event-Handler onorientationchange den man zum Beispiel im BODY-Tag verwenden kann:

 
    <body onorientationchange="alert(window.orientation);"></body>

» Beispiel-Seite