Alright, it’s been a while and this is something I ran into after being told “a lot” of Safari users were having an issue tied to a specific piece of functionality.
Did a little hunting and found a part of the code where we’re taking data from a JSON Ajax call that’s a date (but passed as a string since the whole Microsoft-Ajax-JSON thing screws up dates with a UTC conversion). Thing is, the date isn’t always passed. Sometimes we’ll just get an empty string.
For all the other browsers out there (at least as far as we’ve heard), the following is true:
IF:
var date1 = new Date(“”);
var date2 = new Date();
THEN:
date1 == date2
According to the latest version of Safari (v5), this is not always true. Now, obviously, I need to clean up my code and check for an empty string, ignoring the whole check if it’s blank (which I’m doing now). But, really? Why, oh, why does Apple think it’s okay to do something different here when it’s worked as it has for years now?
Whatever the reason, it’s typical. I get so tired of all the fanboy stuff going on with Apple. It distracts from the various flaws all of their products have, however minor. It’s okay that the Delete button doesn’t work in most applications in Mac OS X. It’s okay that my iPod randomly pulls songs from a different playlist than the one I was listening to. It’s okay that my iPhone 3GS’s Bluetooth drops out 2-3 times when I drive around whereas my original iPhone rarely did it.
Anyhoo, in case you’re unlucky enough to have to support Safari (15% of our traffic!), be on the look out. You can’t pass a blank string into the Date object constructor in JS and expect to get today’s date. It’s possible it’s a weird timing issue (the one with the blank param is created first) and somehow these people are hitting a millisecond border or something thus causing the two objects to represent different values.
Then again, we haven’t heard of anyone on Windows, IE, FF, or Safari 4 having this issue. Could be non-reports but I think we’d have heard something by now if it were common enough as it seems to be now for Safari 5 people.
Looking forward to Safari no longer supporting DIV tags or something else because Steve Jobs ran into a site that had a stray div tag he didn’t like…
kn
Apple’s anti-Flash debacle–yes, debacle–is well known at this point in the post-iPad announcement era.
Now, Virgin makes an announcement about their move away from Flash (and, not to be subjective, any possibility of using Microsoft’s Silverlight) ostensibly to broaden the availability of their Website. I’m not saying they’re doing this to purposely drop-kick Adobe’s Flash which has had a great run for some time now. But, with their expanding iPhone (and soon iPad) platform, Apple’s decision is potentially going to lead developers towards other solutions.
One does exist: JavaScript and CSS. But, one the biggest uses for Flash (and the main reason it’s gotten so mainstream) is support for video–also the most likely reason Apple won’t allow it on it’s mobile platform OS (beyond games). HTML5′s potential for rich media, namely video support.
The HTML5 standard is still a ways away (the target date is 2012). But, as with previous versions, nothing will stop Microsoft, Mozilla, and others from rolling preliminary support into the coming versions of their browsers. Of course, you can be sure Apple will take as long as possible to roll it into Safari…at least on the iPhone.
If the industry pushes this (to the demise of Adobe), Apple’s going to be in a corner. Will that matter? Likely not, knowing Mr. Jobs and his disdain for following the pack. But, there’s going to be a point, sometime in the future, when Jobs and his disciples will need to stop holding that last tiny hill against the non-Apple waves threatening to submerge it.
Still, here’s hoping the push towards HTML5 continues or even accelerates. Dealing with plug-in versions and of course yet another plug-in to check for and support. Don’t get me wrong, though, Flash is still where it’s going to be when it comes to animation and flashy movie sites. JS and CSS can only go so far (though they CAN go far). Will that hurt Adobe? Maybe but who cares? Their support (version 10 was a pain in the ass for people who offer Flash controls for file downloads) and their profiteering off Flash ($699 just to be able to work with it? Maybe you shouldn’t have given it away to the end users…) has built up their egos a bit too much. They were better when they were still fighting Macromedia (remember them? They made Flash) and Quark. They tried. Now, they rule.
kn
A bit old and heavy handed but still a bit funny…
kn