People who know me professionally are fully aware of how annoyed I get when trying to build web applications that are truly cross-browser compliant.  In my current position, I do a lot of web programming in PHP, HTML and JavaScript.  HTML is a no-brainer and PHP (when using AJAX) is usually very straightforward.  Making it all look pretty with the bells and whistles that make the web application work well for the users takes a lot of Javascript and a lot of time.

So, I get very frustrated when I spend a lot of time getting something just right only to find out that when I try it out in another browser it doesn’t work right.  It renders wrong, or where one browser was willing to forgive a small HTML problem, another browser just dies.  For instance, I had a coding issue that caused an extra closing BODY and HTML tag at the end of the document.  For some reason, in IE8 that caused the browser window to hang and the process to hog 50% of my CPU.  It’s the little wierd stuff that can make for a very long morning.

Since I use a lot of JavaScript, speed is important.  I mainly develop using Chrome, since it’s clean and fast, with very little extra stuff to get in my way.  I keep it free from plugins and extensions so that I don’t slow it down any.  It’s JavaScript engine is nice and fast, and Chrome as a whole generally does what is expected.  If I have a problem that isn’t obvious in Chrome, I pull up Firefox to take a look, since it’s helpful sometimes to nail down a difficult problem by looking at the error messages from a different browser.

My biggest headaches, however, have been with Internet Explorer.  Because of some legacy vendor web apps, we have people in our company with IE6, 7  AND 8.  They can’t be upgraded or they’ll break other things.  When I developed my web app with lots of JavaScript, I didn’t know that IE6 and 7 are basically worthless in this area.  They’re just horribly slow.  Code that executes in 4-5 seconds in Chrome would take over 30 in IE7.  IE8 is better, but still pretty slow in comparison to other modern browsers.  IE9 is rumored to be vastly improved, but it’s not going to be available on WindowsXP, so that’s not a solution.

So, I decided to do some testing.  The results show what everyone already knows, which is that IE8 is just sadly lagging behind the rest of the pack. What’s interesting to me, though, is that Firefox is starting to fall behind as well, especially in speed.

SunSpider JavaScript Performance

Sputnik JavaScript Compliance Test

If JavaScript performance and compliance is an issue, stick with Chrome, Safari or Opera.

Oh, how I loathe having to deal with Internet Explorer.

My big web application that I’m always working on was recently released to our internal users in it’s version 2 state.  That meant everyone got to use the new modal windows that I had implemented.  Why modal?  Well, I was trying to avoid using any pop-up windows for the usual reasons – pop-up blockers, losing the pop-up behind the main window, etc….  I also wanted to learn some new techniques, and being able to program modal windows seemed like a cool thing to know.

Well, the users weren’t as receptive to the modals as I’d have liked.  I think if I’d have had a lot more time to spend on them to improve their usability, it would have been fine, but time isn’t something that I have in my job.    So, version 3 is being developed to replace the modals with pop-ups.

One of the first things I needed to do was to re-code the Javascript so that when the user clicks on a report, instead of it loading into a DIV and then displaying the DIV, it opens another browser window and writes the report into that window.  No problem, easy to do, and eliminated a LOT of the modal code that I had written.  Chrome looked good, so did Firefox.  Not so much IE8.

I’ve known for awhile that IE6 and IE7 don’t handle Javascript very well performance-wise.  I use a jQuery plugin called Tablesorter to make my tables sortable and to zebra-stripe the rows.  When users with IE6 or IE7 ran large reports, they’d often have very long wait times as the Tablesorter did it’s thing.  IE8 was a big improvement in that area.

This time, however, something was wrong.  Tablesorter was working well in Chrome and Firefox, but in IE8 is was just crawling.  Simple sorts were taking close to a minute and the zebra-striping was being done one row at a time, so slow that they could be seen.  I checked and double-checked my code, but was stumped.

Well, I’m happy to report that even if I don’t quite know WHY it has a problem with it, I found a way to fix it.  In my original code, I would launch the window, write HTML (including the table) to the window, and then I’d execute the tablesorter function using a jQuery selector referencing the table ID and the pop-up window document reference as the scope.  So, essentially my javascript was executing in my main window but was modifying the DOM of the client window.  It would do it, but was incredibly slow.

After many different ideas, I settled on this.  I launch the window and write to it just like before, but now I include a SCRIPT tag in the header pointing to a javascript file.  Inside that file I use the $(document).ready() to trigger Tablesorter against the table when the DOM has loaded.  Since the javascript is running inside the client window and also accessing the client window’s DOM, the speeds are back to where they should be.

I’m assuming the whole problem has something to do with how IE8 passes the memory references back and forth between window instances, but I can’t be sure.  I did a lot of searching on the net to try and find anyone explaining this, but had no luck.  Maybe someone will read this article and explain it to me.  All I know is that Chrome and Firefox had no problem at all.

H/T to Gizmodo for this one…

With the recent nastiness between Apple and Adobe regarding Flash, this is an interesting comparison of where the major browsers are in their ability to support HTML5 and CSS3.  Click on the image for the interactive version.

HTML5 and CSS3

I think it’s a fairly good estimate that Flash is going to be around for quite some time based on this chart.

Finally.  I just finished moving 4 of my websites tonight.  They were moved from a shared server at an ISP to a new dedicated server that I’m sharing with my brother Aaron, who runs Baugher Webmaster Services.

All of my sites are pretty straightforward, so the move wasn’t too painful.  They are all WordPress sites, so it could be pretty much summarized like this:

On the new system:

  • Create user.
  • Create virtual host directory.
  • Configure Apache for the virtual host.
  • Create the database in MySQL.
  • Create the user in MySQL.
  • Grant the privileges in MySQL.

On the old system:

  • Use mysqldump to dump a copy of the database to a text file.
  • Tar up the WP directory.
  • Transfer the MySQL dump and the tar file to the new server.

On the new system:

  • Edit the MySQL dump to fix the paths to the new virtual host directory if needed.
  • Edit the MySQL dump to fix the username if needed.
  • Restore the MySQL dump to the new database that was created.
  • Untar the WP files into the new virtual host directory.
  • Edit the wp-config.php file to adjust the database name and password if necessary.

Now go to wherever you host your DNS, change the IP for your website’s FQDN, and once the TTL passes, you should be good to go!

The only hitch I had, that Aaron and I worked out, was a bug in WordPress that was keeping the plugin installation/upgrade process from working.  He managed to track down a patch someone had written to fix it, and once I applied it, things were working like normal again.

Aren’t acronyms fun?  Today I spent most of my time practicing using Cascading Style Sheets and Javascript.  I had an application that I wrote recently that still put a lot of the formatting into the main HTML code.  I’ve got most of it moved into CSS.

I’ve been using Javascript for awhile, but mainly for simple things like onClick and onChange triggers.  I’ve been broadening my scope, and today converted some of my back-end PHP into Javascript for things like table row color-coding.  In some ways the PHP way is easier for simple things like alternating row colors, but Javascript becomes necessary to do things like using mouse rollovers to trigger row highlighting.

I’d say the biggest annoyance is that CSS uses different names for certain styles.  For instance, where I’d use “bgcolor=xxxx” in a <tr> tag, in CSS it’s background-color.  Cell-spacing doesn’t exist in CSS, and apparently we are to use border-spacing instead.  It’s not a big deal, it’s just taking some getting used to.

Now that I’ve gotten my feet wet, I need to find some project that demands some really sharp design.  Unfortunately the majority of my coding is internal systems support programs and there’s not much demand for fancy bells and whistles.  I’m going to have to just make up a project of my own.

I decided to split up the links on this site to Tech Links and Other.  Tech Links will be filled with sites that I used on a regular basis, or sites that I recommend to others.  For example, I use Wireshark on many an occasion to troubleshoot client-server software and analyze IP traffic patterns.  I [...]

A friend recently bought a Chumby.  If you haven’t heard of them, a Chumby is basically a network-aware clock.  Those who follow my blog may remember that I posted an article with this idea some time ago.  I’d like to think that I had the idea and the Chumby folks took it from me, but [...]

I’ve had a couple comments lately to my blog that I found interesting.  I don’t get a lot of traffic OR comments most of the time, so I tend to scrutinize those that I DO get. Anyway, in both cases I had someone leave what appeared at first to be a legitimate comment.  Nothing long [...]

I’ve been on Facebook for several months now, giving it a try.  I skipped Myspace when it was all the rage, mainly because it was painful to look at and seemed to be full of teens.  But Facebook seemed to have more structure and less mess, making it at the very least readable. I wasn’t [...]

Dave Lalande at 2 Peas Consulting recently made CNBC news with this article about their new DWDNS product.  Give it a quick read, then come back to my comments. I’ve been in the business a long time.  By business, I mean the Internet, and a long time – well, when I started working for the [...]

© 2010 Virtual Adept Suffusion WordPress theme by Sayontan Sinha