Fork me on GitHub
BjÖrn Blog

jQuery Store Locator Plugin

google_maps

I can’t believe it’s been over a year since I first published my Google Maps store locator JavaScript code. I’ve had several requests for an updated version and that post has definitely received more traffic than any of my others. I’ve finally created a new version of the locator using Google Maps API version 3 and this time I’ve turned it into a full-on jQuery plugin. I re-worked almost everything in the code but I don’t think I’m going to go through function by function like I did in the last post. jQuery should make this store locator much easier to implement and I’ve included several options. Without further ado, here is the full documentation for the plugin:

Continue Reading This Entry »

The Huge Problem with Internet Explorer 9

steve

Microsoft finally released a browser that supports some CSS3 properties. As usual they’re in catch-up mode, but IE9 still isn’t exactly on par with the rest of them. If you check the compatibility chart on findmebyip.com you’ll see there are still some red Xs compared to the other major browsers. What’s the deal with text shadows? Anyways, it might be good enough for now but there’s one gigantic problem that, at least to me, resembles the lovely situation created by the devil’s browser IE6. Microsoft is restricting IE9 to Windows Vista and Windows 7. For front-end developers, this shifts the problem from supporting IE6 (which we can hopefully all agree to stop supporting unless a client pays extra for it) to finding some way to implement CSS3 in IE7 and IE8.

To be fair, yes, it has been 10 years since XP was released but, to give the big M some credit, it’s pretty stable and it’s definitely still the most widely used personal OS out there. I actually haven’t even upgraded my PC yet, but that’s mostly because I want to throw 7 on a solid-state drive and really beef up my RAM. That won’t be an overly expensive upgrade but I’m trying to save more than spend in this economic climate. I believe that XP is going to stick around for quite a while in corporate, educational, and government environments – just like IE6 stuck around.

I’m hoping there will be some kind of easy javascript solution that alleviates the old IEs but I haven’t found anything yet. CSS3 PIE comes close but I found it to be buggy after trying it a couple of times over the course of several months. I’m not sure how often the project is updated but it seems like it’s been in beta (or some test mode) for a while now. There are also several individual hacks and plugins that are available for many CSS3 properties but that seems like a pain and a big waste of time; the more CSS3 you want to use the more plugins you’ll need to find.

Over the past month or so I’ve started using CSS3 very minimally (rounded corners, text shadows… not much more) and have resorted to using javascript for fixes in IE, even though they don’t always work well. I’m thinking of even just degrading for old IE versions where it’s not overly obvious but don’t know if that will fly; I see rounded corners in designs that are so slight or not obvious because of colors, that not many people would even notice if they were square or rounded. It’s difficult to have to resort to fixing bad browsers. Web developers should only need to be concerned with web programming. In the client’s eyes though, you’re the problem, not Microsoft.

At this point I’m going to conclude that Microsoft’s decision to not allow IE9 on XP will hold back most developers, including myself, from using CSS3, which is really sad. I’ve considered Internet Explorer to be a failure for quite a long time and it seems as if Microsoft will always find a way to mess it up over and over. I still don’t get why it took them five years to release IE7. They also never seem to want to jump ahead of the curve and be innovative when it comes to browsers, only copy the best. Microsoft has improved IE and it’s a much better situation than it used to be, but at this point I kind of wish they’d just buy Opera and stop making browsers internally. After all, is a browser really a selling point for an entire OS?

A Google Maps Store Locator in Only Javascript

google_maps

* UPDATE: I’ve re-worked this code and have created a jQuery plugin based on it.

Recently, I was tasked with creating a “store” locator for a local financial institution that has several branches in the Twin Cities area. The problem was that there wasn’t a chance I’d receive access to their server or database and would need to make a special request if I needed access to a server-side programming language. Because of a tight deadline, I decided not to bother working with a server-side language or a database and just create the locator with only Javascript. I knew I wanted to use the Google Maps API and figured there would be at least one example out there I could work off of. However, my presumption was incorrect and I ended up creating it myself along with some helpful snippets of code I came across along the way. It wasn’t an overly complex thing to complete but I figured I’d post it so that anyone else looking to do the same has an example to follow. I made the example very thorough in case you aren’t familiar with the Google Maps API or jQuery.

The locator that I ended up with used an XML file to store all of the location data, which I changed to local Chipotle locations for this example (there are quite a few in the area). I figured that because there weren’t more than 20 branches, I might as well just create the XML by hand and have all the geocoding done with the latitude and longitude in the file. There are obviously pros and cons to this and I wouldn’t recommend it if you have more than 20 or so locations. The speed is nice with everything pre-entered and geocoded and there really aren’t any security concerns, but it takes some time to type everything out. The code I came up with geocodes only the user’s location input but it could definitely be modified to geocode all the store locations as well if needed.

Continue Reading This Entry »

Google Maps Sort by Rating is Gone

google_maps

Google, what have you done!? I’ve noticed over the past couple of weeks that the sort options on Google Maps have been removed, which makes that particular web app/service much less useful to me. I use the sorting options quite frequently to search for high rated restaurants, stores, etc. in my area. Of course, there are alternatives but Google pulls in reviews from several different sources, which make ratings somewhat more reliable.

I usually have a lot to write but that’s all for this entry. I can’t find any explanation on the web and I sure hope the feature comes back soon. Am I missing something?

Ron Paul Wins CPAC Straw Poll? Am I Dreaming?

RonPaulCPAC

I refuse to watch news on TV and turned to Google News as my main source of information a few years ago. All of the large, corporate owned news networks seem extremely biased and negative to me, to the point where it’s never worth watching. I find the huge variety of sources on the internet much more welcoming and actually prefer to read news rather than watch or listen. So when I went to look at the headlines earlier this afternoon, I was completely shocked because Ron Paul’s CPAC straw poll victory was the top story and everyone was covering it.

The mainstream media’s coverage of Paul’s 2008 campaign turned my general distrust and dislike of the media, into more of a hate. I’d go as far as stating that some networks (Fox) even harassed Paul and it surprised me to see how much they will do in order discredit people or information and try to manipulate public opinion. Even now some sites (Politico, Red State – just read the smear headlines, it’s pathetic) are trying to make excuses for Paul’s win. My general feeling on political elections is that all parties and their leading candidates should take center stage at the large political debates and that each news network should cover them as equally as possible; including the Libertarian Party, the Constitution Party, The Green Party and whatever other organized party is out there. I would genuinely enjoy listening to all of them and feel that it’s downright shameful to divide politics by two.

As you might be able to tell, I’m a huge fan of Dr. Paul but his message didn’t stick the first time I heard it. I watched the speeches at the early straw polls of the last campaign and couldn’t initially understand what the guy was shouting about. It really wasn’t until I saw the grassroots movement first hand during the Ames 2007 straw poll (I was a student at ISU at the time) that I really started to listen. It took some time to process Paul’s positions but after a while, everything just clicked. Many people will claim to agree with just a few of his positions but I’m now one of those “crazy” people who think that all of his viewpoints are correct – I voted for him in the primaries and Chuck Baldwin (who I felt was the next best thing after Paul since he didn’t make the ballot) in the ‘08 election.

Paul’s economic positions were the real turning point for me. It wasn’t just his warnings about a collapse but also the entire Austrian economic philosophy (versus Keynesian). We must not forget that Paul, along with other Austrian economists, saw the current economic situation coming and their warnings were repeatedly ignored by the mainstream media. Since the election, I’ve started reading more and more on Austrian economics and completely support the philosophy. The Mises Institute puts out a wealth of great information on the subject and for those who aren’t particularly fond of economics, I’d highly recommend any videos by Tom Woods Jr. – who is by far one of the most entertaining proponents.

I don’t know what Dr. Paul’s CPAC victory means today but I was delightfully surprised by the news. At this point Paul has repeatedly dismissed plans for a 2012 run but if this is the beginning of a much larger movement, you never know what could happen. If anything, I hope it brings a much needed shift in the GOP back toward fiscal conservatism and the core principals that originally shaped the Party; and away from neoconservatism, which unfortunately seems to be popular.

Paul’s CPAC speech is on YouTube: Part 1, Part 2, Part 3

Some Pros and Cons of MODx

modx

MODx is an up and coming PHP/MySQL content management system that’s easy to use and has plenty of nice features. The project began in 2004 as a fork of Etomite. I’ve used it for a few projects now (not extensively) and think it works great for small sites; sites with less than ~15 pages that don’t have a lot of dynamic content. I really like the direction that MODx is headed but there are certainly some drawbacks that prevent me from using it on more of a regular basis. I thought I’d post a small list of what I believe are the current pros and cons of the system for anyone who is considering it.

Pros:

  • Quick loading: Unlike most CMSs, MODx doesn’t add tons of irrelevant markup to your HTML and instead of loading the skins from regular HTML files, they are loaded from the database; no clutter and database loading makes page loading very quick. The MODx wiki has a great skinning tutorial that might look a little daunting at first, but it’s really easy to follow. The CMS on the whole doesn’t seem bloated at all.
  • Templating code is extremly simple to work with. I’ve had the unfortunate experience of working with the PHP Smarty template engine and I really detest it. To me, Smarty doesn’t make sense because it’s so similar to regular PHP. Why even bother? MODx template code uses “snippets” and “chunks” which you basically just plug into your normal HTML code. The following statement that is prominently displayed on the MODx home page is what really caught my attention: “Finally, go straight from XHTML/CSS/JS mockup right into the Content Management System.”
  • SEO friendly out of the box. SEO optimized CMSs are the new standard and MODx definitely takes search into account. It’s very easy to set up URL rewriting, page titles and meta tags, etc.
  • It’s easy for clients. The quick edit feature seems fantastic for clients. So far, most seem to be able to catch on very easily with little instruction. It’s basically just a matter of understanding whatever WYSIWYG editor you decide to implement. The default editor is Tiny but there is a plug-in for Fckeditor among others.
  • Community support: The MODx forums are a great source of support. I’ve posted several questions and someone has always responded very quickly.

Cons:

  • User roles and permission settings are confusing and groups need to be combined. There are currently two sets of user groups: the Web Users group and the Manager Users group. So, for example, even though you have your admin account set up as a manager, the login will not work for the web login.This is extremely annoying but apparently the two main sets of groups will eventually be merged; the sooner the better I say.
  • Most plug-ins should use installers and adding them to documents should be as easy as possible. Another huge drawback to MODx is that many of the plug-ins available require users to copy and paste code into snippets and chunks. As easy as that seems for a web developer, it’s going to be too confusing for regular people with little web experience. In addition, instead of directly typing chunk code into the Resource content editor, to make things as easy as possible there should be some kind of checkbox/drag-and-drop menu for adding chunks to pages.
  • Blog/Article setup should be much easier. Setting up Ditto for news articles or a blog is pretty simple if you install the example website but it’s not easy enough for someone coming from something such as WordPress. Ditto also lacks features and much more work should be done with it in order for the CMS to compete with the popular blogging systems. Posting articles is really a core function that every CMS should have by default and if it lacks at all, the entire system will suffer.

Why Are There Ads For Prescription Drugs?

I don’t watch much television on a regular basis anymore for a variety of reasons, the primary being that I refuse to pay for cable until ala carte options are available. However, now that the NFL has started up again, which I really enjoy watching, I’ll be tuning in quite a bit more in order to watch the games. Usually I’m just interested in the Vikings and the NFC North but I’m in a fantasy football league for the first time this year and my watching habits have definitely increased. For the last several years I’ve noticed that there has been an ever-increasing amount of prescription drug advertisements, known as direct-to-consumer (DTC) advertising, and they are commonly shown during sporting events. For a long time I’d get frustrated when these spots would run through the side-effects list, which can quickly spoil an appetite or cause a bit of awkwardness in the room. After thinking about it a bit more though, I couldn’t help but think to myself – why are there ads for prescription drugs in the first place? This is something that is just really puzzling to me. Why is it even legal?

Continue Reading This Entry »

Embryonic First Impressions

Embryonic

I love The Flaming Lips; well, everything they’ve done since Clouds Taste Metallic that is. With the exception of a few songs, their early stuff just doesn’t really appeal to me much. I’d describe the band’s current music as a crazy mix between Pink Floyd and Radiohead. The music definitely pays homage to the 60s and 70s, which is at this point my favorite music era – I have more favorite groups from that time period than any other and I think the explosion of creativity and rebellion was absolutely incredible. As just one example, ever notice how My Cosmic Autumn Rebellion is basically a loose cover of The Kinks’ End of the Season? There also seem to be several similarities to Pink Floyd’s early work. Wow! Speaking of Pink Floyd, I was just reading a bit on Wikipedia and noticed that the band’s next album will be a cover of Dark Side of the Moon! I almost fell out of my chair when I read that – just announced yesterday.

Anyway, I went all out and pre-ordered the limited edition that comes with the extremely high quality music on DVD as an extra. I’d say I’ve listen to Embryonic at least 10 times at this point and at this point I think it’s a fantastic addition to the collection. That being said, people should be aware that the album is mostly experimental, strays far from the pop-like songs of the last few albums that are easy to follow and sing along with, and seems to be heavy on the instrumentals and light on the vocals. Is this a bad thing? Not at all in my opinion but some of the newer fans that have been attracted to the band by their more “catchy” tunes might be a little disappointed. The only thing I find disappointing is the fact that it’s only about 70min. long. This experimental, jam session-type music usually goes on longer and is just more drawn out, in general, with other bands. For example, occasionally I like to listen to Nine Inch Nail’s Ghosts while doing work at my computer, which is about 2 hours in length. I’m not a big NIN fan but seem to like listening to experimental, mostly instrumental albums in the background when working.

The songs that have stuck with me the most so far include Watching the Planets, Worm Mountain, and probably The Egos’ Last Stand. Disc 2 definitely seems to have more highlights for me though there are maybe only one or two songs that I’d continuously skip. Haunting, dreamy, humorous (I Can Be A Frog), and hypnotic – this is a must own for Flaming Lips fans and anyone who can appreciate a great experimental/instrumental album.

I’d rate it a 4/5.

The Downward Spiral of Facebook

The glorious college days

Facebook used to be great. I signed up for an account during the second half of my 2003/04 freshman year during college and at that time, it was really new just starting to spread. Because of my strong interest in web development and technology, I’m of course always trying to follow the latest trends. At that point the site was only open to college students and alumni, if I remember correctly, and it was so nice to see a social networking site that didn’t look like a virtual ghetto. I absolutely detest MySpace and have never created an account there. Browsing that site is just like asking for a virus or spyware – not to mention the awful background images that people put up that make pages impossible to read along with the animated .gifs and of course, don’t forget the blasting music that you’d really rather not listen to.

Facebook caught fire quickly on college campuses and it made connecting with, or finding people, incredibly easy. Not only could you add all your courses to your profile but you could also break it down further by adding your section/recitation. Asking someone for help or setting up a study group for the next exam was the best thing I had seen on the internet in a long time. The greatest part was that tons of people starting signing up, filling out profiles, and adding classes, not just the technically enlightened.

Continue Reading This Entry »

Classic Shaving Revival

For this blog entry I thought I’d share an example of how powerful amateur videos and information on the internet can be; acting in a similar way that word of mouth recommendations and marketing work. This example focuses on the shaving industry and Gillette in particular, now owned by Procter & Gamble.

Razors, blades, and the marketing for them have changed quite a bit over the past 50 years. You’ve seen the ads. Nowadays the TV spots will often feature some guy looking in a mirror while shaving in a towel, with perfect abs and pecs, zero body hair, perfect shaving cream application that looks like rubber, along with a scantily clad bimbo gawking and giggling in the background. During Gillette’s previous “Mach” era, they would also feature jets whizzing by on screen… what a huge selling point, and oh, how masculine! Their latest product is the “Fusion” razor, which uses five blade cartridges and also comes in a battery powered version. Do you really need 5+ blades and more importantly, why would you ever need a safety razor to be electric? The advertisements have changed with the “Fusion” line but remain just as corny. They now try to feature this fusion technology as something that’s really advanced and high-tech. More recently, they even tried to target video gamers but in my opinion, failed to make a connection. Saturday Night Live mocked the then fictitious 3 bladed razor in 1975, with the “Triple-Trac” skit featuring Al Franken as a caveman searching for a “close shave.” It was only 23 years later, in 1998, that Gillette first introduced the “Mach 3”. It certainly wasn’t the last time the company was ridiculed either. SNL also did a “Platinum Mach 14” commercial featuring John Goodman in 2000 and The Onion published a five blade article (warningexcessive profanity) in 2004, which was of course 2 years before the “Fusion” was introduced.

Continue Reading This Entry »

profile
Hello! My name is Björn and I'm a web developer at an advertising agency in the Minneapolis area. I have many interests and opinions that I'm going to be writing about. Thanks for stopping by.