Archive | July, 2009

Dienstwagen geklaut?

Tags:

Schnelle Hilfe für Ulla Schmidt?!

Posted on 29 July 2009 by michael

Dienstwagen geklaut?gerade bei google gefunden ;-)

Comments (0)

The fastest Firefox: The final Video

Tags: ,

The fastest Firefox: The final Video

Posted on 23 July 2009 by michael

Comments (0)

Tags: ,

String.print()

Posted on 21 July 2009 by michael

Habe mal wieder mit JavaScript gespielt, heraus kam eine Methode, direkt Texte auf einem Drucker auszugeben (Ok, der System Druckdialog ließ sich nicht umgehen, ist aber auch besser so!)

String.prototype.print = function(){
    var ifr = document.createElement('iframe');
    ifr.style.visibility = 'hidden';
    document.body.appendChild(ifr);
    ifr.contentWindow.document.open();
    ifr.contentWindow.document.write(this);
    ifr.contentWindow.print();
    ifr.contentWindow.document.close();
};

Ein paar Beispiele:

"Hello World!".print();
"Hello <strong>World</strong>!<br>This is a test!!".print()

Dieser Codeschnipsel habe ich bislang nur unter FF getestet, funktionierte!

Played again a bit with JavaScript and created a small code-snippet which let you print out a String on a printer without opening a popup-window.

String.prototype.print = function(){
    var ifr = document.createElement('iframe');
    ifr.style.visibility = 'hidden';
    document.body.appendChild(ifr);
    ifr.contentWindow.document.open();
    ifr.contentWindow.document.write(this);
    ifr.contentWindow.print();
    ifr.contentWindow.document.close();
};

Two small examples:

"Hello World!".print();
"Hello <strong>World</strong>!<br>This is a test!!".print()

I have tested it only with Firefox, worked good for me.

Comments (0)

Photos from our Flickr stream

See all photos

josi_de@twitter

GitHub Projects