Developer of location based application, a frontend specialist for Google Maps API and page optimization.

psykmedia

timestamp: 1283856861

// Delicious | Bookmark update

Vor kurzem habe ich die Tags meines Delicious-Accounts etwas aufgeräumt.

Ich kann mich Irren aber, ich denke, man kann einen leichten Trend erkennen. ;-)

// Prototype | Element insert

Kürzlich suchte ich im Prototype Framework nach der richtigen Verwendung der insert-Methode. Doch leider ist die Dokumentation in diesem Fall etwas widersprüchlich.
Hier nun in aller kürze die richtige Anwendung der Funktion.

  1. <div id="content">
  2.   <div id="foo">bar</div>
  3. </div>

Anstatt erst das Element als Parameter zu übergeben, wird gleich mit einem Object begonnen, in dem die gewünschte Position (after, before, top oder bottom) übergeben wird, gefolgt von zusetzenden Inhalt.

  1. // platziert neues Element vor dem 'foo' Element
  2. $('foo').insert({
  3.   before: new Element('div', {
  4.     id: 'before_foo'
  5.   }).update('before foo')
  6. });
  7. // platziert neues Element nach dem 'foo' Element
  8. $('foo').insert({
  9.   after: new Element('div', {
  10.     id: 'after_foo'
  11.   }).update('after foo')
  12. });
  13. // platziert neues Element am Ende des 'content' Elements
  14. $('content').insert({
  15.   bottom: new Element('div', {
  16.     id: 'bottom_content'
  17.   }).update('content at the bottom')
  18. });
  19. // platziert neues Element am Anfang des 'content' Elements
  20. $('content').insert({
  21.   top: new Element('div', {
  22.     id: 'top_content'
  23.   }).update('content at the top')
  24. });

Inhalt abgleichen

// My tweets

  • We are sitting in a nice cafe in Downtown Vancouver. This city is really impressive. But the weather could be better. #vancinsep

    vor 12 Stunden 14 Minuten
  • Yuhoo, it jeht los! We starts our journey from Hamburg to Vancouver. #vancinsep #travel

    vor 2 Tage 19 Minuten
  • Best New Mashups: Point A to Point B http://bit.ly/cs2pke

    vor 1 Woche 5 Tage
  • Introducing Yeti: The YUI Easy Testing Interface http://bit.ly/djNBT8

    vor 1 Woche 5 Tage