PHP and PDF in pure Javascript

Javacript is the very first base stone concerning web 2.0. In the past, I always heard bad things about Javascript, but I guess all of them were said because Javascript was being used by the wrong people, in the wrong place and at the wrong time.

A lot of sites use huge Javacript libs, each one performing nice things, such as HTTP requests, animation effects, generation of RIA content, etc. Javascript is so famous now that several things have been ported to it, such as encryption algorithms.

I have found two of those Javascript ports that can be really useful, specially if you are a PHP developer (just like me): PHP.JS and jsPDF.

PHP.JS is an open source project in which you can use PHP functions client-side, in pure JavaScript. jsPDF is an open-source library for generating PDF documents using nothing but Javascript.

Webapps brought to the Desktop

Some years ago, the only thing that came to my mind when I heard the word "web" was "very simple websites", a bunch of bytes available for browing. Google was not even born at that time and everyhing was focused on desktop applications. If your application was able to connect to the web, then it could update itself in a easy way, nothing else.

The main flow was to bring every single business plan into the desktop world: office stuff (such as Microsoft Office), e-mail (Outlook), image, music, movies, etc. In the web world at that time, Javascript was an ugly word to be fired and Flash was just a way to make things look a little bit better.

The world is different now and ironically it seems to be the opposite of what it was in the past. Instead of bringing things into the desktop, the idea is to take them to the cloud, make them available on the web. This is happening very fast, but sometimes it's useful to have some desktop behavior in a web app, such as offline access to your e-mails.

webappers

Why can't we use the best things of those two words (web and the desktop)? Even better, why can't we use our web development knowledge to create hybrid apps that work in those two worlds? In fact, we can, and a lot of people have noticed that.

The first one I can recall is Adobe with Apollo, on March 19, 2007. Apollo, after named to Adobe Integrated Runtime (AIR), is a cross-platform runtime environment for building rich Internet applications using Flash, HTML or Ajax, that can be deployed as a desktop application. A very powerful tool able to create nice apps featuring half desktop half web blood.

Right after Adobe, Mozilla started working on a similtar idea and on October, 2007, Prism was born. It is open source, like all the things Mozilla does, and it splits web applications out of the browser and run them directly on the desktop. Prism development is not fast as Adobe's AIR is, but they are moving forward.

These days I've found a brand new tool like those previous ones: Appcelerator Titanium. As far as I could see, it works just like AIR, but it is open source. I read a few forum threads at Titanium forum and some developers said their Titanium apps were running faster then their AIR versions. Another very nice thing is you can use sevel languages to code your application, such as PHP and Phyton instead of only HTML and Javascript.

If you were thinking about developing an desktop-and-web application in a easy way, take a look at those options above. I'm sure you will have a lot of heavy weapons available to make your ideas to come true.

IE6 has already fulfilled its destiny, it’s time to upgrade!

One of the most annoying thing I did during the development of our web projects was to keep our apps running smooth in a wide range of old browsers. Not too many years ago, there was only one "king" in the browser's kingdom: Microsoft Internet Explorer. King is a little bit unappropriated, however on February, 2005, IE 6 was pumping the web engines with a market share of 82.79%, what is a quite impressive number.

Excluding the security problems, the non W3C compliant behavior and other issues, IE6 as the only major browser would be a great deal to all web developers. The existence of  just one browser means few environments to test and few compatibility if/elses. The web-developers burden, however, was far from being released.

In 1996, Opera was first released publicly with version 2.0. Coming next, Apple first released Safari as a public beta on January 7, 2003. Following the flow, in November 9, 2004, Mozilla came up with Firefox 1.0. The last one to join the party was Google Chrome, released as a public beta on September 2, 2008. With the built-in markup madness that HTML allows and with no clear rules for how a browser should behave, the web development became a nightmare.

Luckly things got better and the development of major browsers started to have its foundations over W3C standards and performance worries. Every new version of each browser introduced a set of brand new stuffs, including security improvements and higher Acid scores. Everything would be great, except for one huge problem: IE6, an old and obsolete browser, is still widely used!

That problem drastically increases the complexity of web apps, because developers, in order to ensure the website will look fine, have to workaround all the stupid things IE6 does. As the WordPress guys usually say, "code is poetry"; in my opinion IE6 compatibility code is classified as a bunch of ugly words within a rhyme. It's time to move on, let IE6 go!

To tell that to your users, a good approach is the ie6 upgrade warning. It is a little script (7.9kb) that displays a warning message politely informing the user to upgrade the browser to a newer version (links to newest IE, Firefox, Opera, Safari, Chrome are provided).

Make the Internet a better place, let old things in the past and move on to the new ones. Upgrade your browser.