Warning: Cannot modify header information - headers already sent by (output started at /home/cssquirrel/www.cssquirrel.com/blog/index.php:4) in /home/cssquirrel/www.cssquirrel.com/blog/wp-includes/feed-rss2.php on line 8
CSSquirrel » Browsers http://cssquirrel.com/blog opinions and news on web design Wed, 18 Jan 2012 18:10:41 +0000 en hourly 1 http://wordpress.org/?v=3.3.1 jQuery, JSON and IE – Getting Incorrect Array Length http://cssquirrel.com/blog/2008/10/14/jquery-json-and-ie-getting-incorrect-array-length/ http://cssquirrel.com/blog/2008/10/14/jquery-json-and-ie-getting-incorrect-array-length/#comments Tue, 14 Oct 2008 20:24:58 +0000 Kyle Weems http://www.cssquirrel.com/?p=106 Has anyone had the following problem? When loading a JSON array (through something like $.getJSON), Internet Explorer will sometimes report the length of the array being one higher than other browsers, with the extra element in the array being blank.

I don’t know if this is a problem in other libraries, but I suspect it is. But I do know that it’s happened to me when using jQuery’s Ajax functions.

Why is this occurring?

I was tormenting myself with this same question on a client project, and discovered that although a bit of browser quirkiness was involved, it was actually an error on my part.

I hate it when it’s me. ;)

As it turns out, I had an extra trailing comma at the end of the last element in my array. For example, in the following array:

{“gamesImDroolingFor”:[{"developer":"Blizzard","title:"Diablo III"},{"developer":"Square Enix","title":"Final Fantasy XIII"},]}

You’ll notice that there’s a comma after the last game’s bracket (which has been turned red for emphasis).

Firefox will ignore that comma, since clearly there’s no new object after it. Internet Explorer, the special child of the web, isn’t quite so bright, so it adds an extra, blank element to the array it creates.

Go IE.

The solution is easy, of course. Remove the unneeded comma.

I hope this helps prevent other developers from driving themselves batty trying to figure out what’s going wrong with their own arrays.

]]>
http://cssquirrel.com/blog/2008/10/14/jquery-json-and-ie-getting-incorrect-array-length/feed/ 6
Google Chrome? http://cssquirrel.com/blog/2008/09/02/google-chrome/ http://cssquirrel.com/blog/2008/09/02/google-chrome/#comments Tue, 02 Sep 2008 19:56:13 +0000 Kyle Weems http://www.cssquirrel.com/?p=73 I’m not entirely surprised that Google decided to release its own browser. Considering their whole web-based business model it was probably inevetible. Although you have to wonder how it’ll affect their funding of Mozilla.

What does surprise me is that I heard nary a peep before today’s beta. I feel like a back-country rube that just learned about horseless carriages.

Anyhow, here it is. I like that it’s open source (encourages other browser makers to see what good ideas they’ve created and theoretically incorporate them), but I admit that I’m curious how it’ll shake up the browser usage wars.

You can download it here, and see their official post about it here.

]]>
http://cssquirrel.com/blog/2008/09/02/google-chrome/feed/ 1
Firefox Launch Day On Tuesday http://cssquirrel.com/blog/2008/06/16/firefox-launch-day-on-tuesday/ http://cssquirrel.com/blog/2008/06/16/firefox-launch-day-on-tuesday/#comments Mon, 16 Jun 2008 16:11:21 +0000 Kyle Weems http://www.cssquirrel.com/?p=35 When it comes to browsers, Firefox is my primary choice. It’s combination of strong standards support and large addons library makes it not only desirable, but indispensable in how I browse and work on the Net. I know I can do web development without Firebug, but I certainly don’t know why I’d want to.

Although I’ve been running the beta (then later the release candidates) for some time now, I’m excited for the upcoming official release of Firefox 3 tomorrow. Although I hadn’t planned out a release party like Mozilla has encouraged as part of their Download Day 2008 event, I’ll definitely be upgrading to the release version to help with their “most downloads in one day” goal.

In related news, while I’ve made it clear how much I dislike their tendancy to swing at IE without checking if their own zipper is up, I am also glad to see Opera 9.5 has been officially released, bringing with it a slick upgraded interface, more speed, and overall better standards support (but still no CSS3 rgba color support yet.) Between those two and Safari, a lot more CSS3 and other standards-related features are becoming available in 2008.

Now if only Microsoft would get off it’s lazy rear and announce a general target for when they plan to release IE8. Preferably this year…

]]>
http://cssquirrel.com/blog/2008/06/16/firefox-launch-day-on-tuesday/feed/ 2