Pages

Showing posts with label Development. Show all posts
Showing posts with label Development. Show all posts

A Foot On The Bottom Rung: First Forays Into Responsive Web Development

Responsive design is the hottest topic in front-end Web development right now. It’s going to transform the Web into an all-singing, all-dancing, all-devices party, where we can access any information located anywhere in the world. But does responsive design translate well from the text-heavy Web design blogosphere to the cold hard reality of commercial systems?

Rumors came through our office grapevine that management was looking to revamp our mobile presence. There was talk of multiple apps being built externally that could be used on some of the major mobile devices. Our team had been getting familiar with responsive design and put forward a proposal of doing away with device-specific apps and developing a single responsive website that could be served to both desktop and mobile users. After a few hasty demos and prototypes, the idea was accepted and we began work.

The brief: make our current website, Airport-Hotels.uk, responsive while retaining the existing layout for users on browsers of 1000 pixels and up.

The following is what we picked up along the way.

The general consensus now seems to be “mobile first.” I agree. Starting with a single(ish)-column mobile website is the easiest way to get your CSS off to a great start. However, we use an external design agency, so the time and cost of a new mobile-first design was not feasible. It was left to the front-end developer to translate the existing design onto screens of smaller dimensions.

The solution was to break up the website into smaller blocks (or nuggets), which could then be positioned differently as the browser’s width increased. This led to our first base media query, which contained the main branding elements, with minimal layout information. Because the nuggets were of a fairly fixed size, we had a foundation for creating a grid for each of our major media queries. Anything that wasn’t deemed to be a “nugget,” such as a larger block of text, would be responsive and fill in the gaps that the nuggets couldn’t.

Mobile view of availability results

While this method is not as good a practice as “mobile first,” it does have the advantage of being faster and cheaper than a full redesign. And you pick up great knowledge along the way for when resources do become available for something more substantial.

When getting your feet wet with media queries, you’re tempted to go all out, but do you need to? Theoretically, you could serve a completely different design to each “major” screen resolution. While this would be spectacular and self-satisfying, maintaining it would be a nightmare. We ended up using the default media queries in Andy Clarke’s 320 and Up framework, containing four breakpoints (1382 pixels was not in the brief). Looking back now, we could have removed at least one of those queries, possibly two.

We’ve been gathering statistics in the weeks since the website’s release, and by far the majority of our customers are running browsers either of 320 × 480 pixels or on full desktops. We could hit over 85% of our user base by focusing on these resolutions, while cutting down on development time and maintenance.

This was especially evident on our availability page, which easily contains the most information of any of the pages in our booking flow. In the end, rather than try to serve the perfect design to each device width, we moved much of the CSS for the largest media query to the size below: less maintenance, less fuss, and more time to work on the UX (and, importantly to the business, to make bookings).

When I first saw tools like Modernizr, I thought they would change everything. I suppose they have, but don’t rely on them too much. Mobile browsers have more inconsistencies than any desktop I have ever seen. Even WebKit-based browsers can render things completely differently. With debugging tools at a minimum, it’s like we’ve been thrust back into the pre-developer toolbar era of IE bug fixing. Luckily, that’s one of my favorite things.

Exploring this strange new world of bugs became one of the major aspects of the project. A few of my favorites are highlighted below. Hopefully, they won’t trip you up.

I love CSS columns. I had been wanting to use them for a while; but, other than small personal projects, nothing with appropriate content came up. While trying to work out the best layout for our website on a 320-pixel device, I realized that, rather than generating columns using floats or inline blocks, we could reduce the layout CSS to just a few lines by creating CSS columns. With most major mobile Web browsers being based on WebKit and Opera, this seemed to be a fairly reasonable solution and appeared to lay out everything perfectly. Great!

Here is the original code for the 320-pixel media query:

.product { -moz-column-count: 2; -moz-column-gap: 5px; -webkit-column-count: 2; -webkit-column-gap: 5px; column-count: 2; column-gap: 5px;}

And here is the updated solution (roughly speaking — the actual code was much longer):

.product>div { width: 49%; float: left; margin: 0.5%;}

Unfortunately, the column specification isn’t quite ready yet. On BlackBerrys and some HTC Android phones, our form elements (specifically, the buttons) became unclickable. The layout was perfect — we checked that the CSS was accepted with Modernizr, and all the links worked — and yet you couldn’t click the “Book” button. Back to the drawing board with that one.

We ended up using a more standard float-based column layout.

Gradients were another excellent instance of browser idiosyncrasies. We used a lot of CSS gradients in this redevelopment to replace some images. This should have saved the user’s bandwidth and made redesigns and maintenance faster.

On WebOS (with a WebKit-based browser), though, CSS gradients would render as completely black unless used on a form input element. It was baffling. In the end, we figured out that it was a bug in the implementation of -webkit-linear-gradient. We’ve learned that the bug has been fixed in the upcoming version, so this might not be an issue in the future.

Here is the offending CSS:

.ppcHeader { background: #73bff1; /* Old browsers */ background: -moz-linear-gradient(left, #73bff1 0%, #009ff7 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, right top, color-stop(0%,#73bff1), color-stop(100%,#009ff7)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(left, #73bff1 0%,#009ff7 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(left, #73bff1 0%,#009ff7 100%); /* Opera11.10+ */ background: -ms-linear-gradient(left, #73bff1 0%,#009ff7 100%); /* IE10+ */ background: linear-gradient(left, #73bff1 0%,#009ff7 100%); /* W3C */ margin-bottom: 20px;}

(Bear in mind that CSS gradients add a heavy load to the browser’s rendering engine, so if you are using a lot of them, switching them off for mobile might be wise.)

Basically, JavaScript does not work on Blackberry 5.0. BlackBerry tries, but it’s so inconsistent and buggy that it’s not worth it. We were reliably advised by Peter-Paul Kochs to just resort to device sniffing and to turn off any JavaScript. This is another reason to make sure your websites are progressively enhanced by falling back to non-JavaScript versions.

Meanwhile, Opera Mini works fine with JavaScript, but each of a website’s pages is rendered on Opera’s servers and then essentially compressed into a big image before being sent to the mobile device. This is great for the user because it can reduce bandwidth to 10% of the normal browsing experience. On the other hand, if you have onkeyup validation in your forms, this can be a problem because each call to the JavaScript would require refreshing the entire page from the server.

This was and still is one of the major problems with mobile browsing on our e-commerce website. In order to make a purchase on an average website, the user has to fill in a lot of information: names, addresses, credit-card details, the list goes on and on. While typing on mobile has gotten much easier, navigating large forms is a frustrating and laborious process.

Our mockup payment page had 22 form inputs that needed some kind of interaction. These were required either to make a successful booking, to provide information to the product supplier after booking or for our own sales and data purposes.

Payment form desktop view
Airport hotels payment form, a large screen view. Large version.

Payment form mobile view
Airport hotel’s payment form, a small screen view. Large version.

The question became (as it always seems to be with mobile), what could we remove and what did we have to keep? Well, we tried to take the middle path, which is currently in development or might even be live by the time you read this.

We chose to split our payment process into two stages. Because our users can save more on their purchase by booking early, our first payment stage asks for the very minimum of information required in order to confirm a booking: name, car registration and credit-card details. This gives the user the best price available and chalks up another booking for us. Part two of the payment process is to gather the rest of the information required to “complete” the booking. This second stage can be filled out at the user’s convenience, either immediately or later on using our online booking management system. This eases any frustration caused by having to fill out a large form.

A good user interface means something completely different on mobile devices — and even tablets for that matter. Many of the user-friendly features we have implemented on our desktop website would just be bad ideas on these smaller mouse-less devices.

Lightboxes were all the rage a few years ago. They were a convenient and pretty way to display a small amount of content or something that wasn’t worth loading a new page for. In IE 7 and up, you can position lightboxes using position: fixed, which is great. On mobile devices, though, browsers do not implement position: fixed, or they implement it in an odd way to prevent non-mobile-ready websites from not working at all. This will ruin any lightboxes.

We recommend just loading a new page for lightbox content: less JavaScript, easier and fast. A new tab would also be fine, but due to the infancy of tabbed browsing on mobile devices, maintaining the flow is probably a better idea for now.

Content that is only visible via hovering obviously doesn’t work on touchscreens. What used to be an easy way to hide content while keeping it accessible has become a bit of a nightmare to deal with. We tried just removing the hover and showing the content, to see what would happen. The iPhone actually handles hovers fairly well, translating them into tap events. On Android, you need to click and hold for a little while to prevent the default action of clicking the link (our links are anchor-tag-based).

In the end, modifying the code that handles the hovers (assuming it’s JavaScript) and adding a tap event seemed to be the best solution. This allowed us to preserve the design’s aesthetic, while keeping as much functionality as possible for mobile users.

if( document.createTouch ) { this.addEvent(c[j],'tap',this.tipOver,false);} else { this.addEvent(c[j],'mouseover',this.tipOver,false); this.addEvent(c[j],'mouseout',this.tipOut,false);}

Our date-picker calendar was one of the biggest hurdles to overcome in the UI. We have a text input that allows the user to enter a date. Prior to the date-picker, our solution was a dynamically generated select box, but that caused confusion among many users because they might have remembered the day of the week they were flying on but not the date. So, we added the jQuery UI Datepicker to make filling in the search form one step easier.

However, what was one step forward for convenience on the desktop was one step back on mobile. Focusing the text input would open both the date picker and the phone’s keyboard, thus obscuring the date picker.

Our next option was to use the HTML5 date input. Because this element became available so recently, browsers are still playing catch up, and implementations vary wildly. It’s just as rough on desktop, with Firefox still rendering it as a text input, Chrome adds an up/down selector and forces the date format, while Opera actually renders a calendar just like the jQuery UI Datepicker. This solution still requires the date-picker JavaScript, but it forces the format, which can actually make it less user-friendly. While the concept is great and the solution will be great once the bugs are ironed out, we found that the date type input is not yet ready for commercial use in this fashion.

Our eventual solution (not yet live) was to use a JavaScript “touch event” query to generate a more mobile-friendly date picker than the standard jQuery UI one. This creates an iOS-styled triple drop-down menu for day, month and year and is user-friendly on mobile devices. The no-JavaScript backup can be either a text input or a select drop-down menu. Have a look at the code for yourself.

The final point, which reflects the complexity of mobile development, is how to fit old versions of IE into this new technology. IE 8 and below ignores media queries, which presents a rather sticky problem when your entire website is based on them. There are several solutions to this, which we’ll explore below.

I can think of two great JavaScript polyfill options for media queries. The first is Respond.js, which continually monitors the browser’s width, parses the CSS and then serves the correct styles for that width. This is a great solution if you need the website to respond on IE 8 and below. The main issue is the time between the document loading and the JavaScript kicking in; the website is initially displayed using the base style sheet, usually the mobile view, before it “jumps” to the full desktop version. Obviously, this doesn’t look great on a desktop monitor, and if the user is on an old browser, then their computer and Internet connection will probably be slow, too, which means that the jump time could be even longer.

The other JavaScript option here is the Chrome frame, which achieves the same end and has the same disadvantages. This solution isn’t bad, but just not right for our implementation.

This is one of my favorite options for responsive websites and is also used in the latest version of the 320 and Up boilerplate. Create a separate CSS file for each device width; and for IE, serve them all to the user, with no media queries. With a mobile-first approach and a couple of fixed widths in your IE style sheet, this will serve the full-sized version of the website to users of outdated browsers. This solution is fast, simple and easy to maintain.

Finally, given the right conditions, you could just write a completely separate IE style sheet, full of conditional comments to load the full desktop version of the website. Theoretically, this need only contain small amounts of layout information; but given that many of these styles will be reproduced in your media queries for wider widths, it can cause maintenance issues down the line. Duplicating code is never a good idea, which makes me wary of this solution.

Interestingly, we used this solution in the end, but with a twist. We used a PHP plugin in our template files to combine, compress and cache our CSS files. Due to some issues with the cache in IE, we were already generating a separate cached CSS file for IE users. We added a couple of lines to the PHP file to strip out media queries entirely as it combines and compresses the CSS. This method delivers the results of the “include all media queries” solution, while allowing the option for inline media queries in the style sheet. Because of the way we organized the CSS, this turned out to be the best solution for the project.

After all that, we finally have the first version of our responsive booking flow. I like to think that this epitomizes “mobile-ready.” We aren’t necessarily mobile-optimized, but our feet are on the bottom rung of a tall ladder that climbs to a great system that works perfectly on all devices. This is the starting point, if you will.

Was it worth it? It’s been a long journey, with a lot of head scratching and learning on our feet fast, but that’s what Web development is about, and I wouldn’t have it any other way. You can’t be perfect the first time round, and you don’t have to be. The point is that this technology is ready now, and the sooner you start using it, the better prepared you’ll be for the mobile market as it comes running at you. In the next few years, we’re hoping to see JavaScript network APIs that will allow Web users to add purchases directly to their monthly phone bill. I expect the mobile e-commerce market will explode at that point. Will you be ready?

(al) (da) (il)

Gavyn McKenzie likes downhill skateboarding, pondering semantics, painting with CSS and fine gastronomy. He is currently employed as a front-end web developer at Holiday Extras and dabbles in freelance work for interesting clients.

Yay! You've decided to leave a comment. That's fantastic! Please keep in mind that comments are moderated and rel="nofollow" is in use. So, please do not use a spammy keyword or a domain as your name, or it will be deleted. Let's have a personal and meaningful conversation instead. Thanks for dropping by!

Read more >>

A Foot On The Bottom Rung: First Forays Into Responsive Web Development

Responsive design is the hottest topic in front-end Web development right now. It’s going to transform the Web into an all-singing, all-dancing, all-devices party, where we can access any information located anywhere in the world. But does responsive design translate well from the text-heavy Web design blogosphere to the cold hard reality of commercial systems?

Rumors came through our office grapevine that management was looking to revamp our mobile presence. There was talk of multiple apps being built externally that could be used on some of the major mobile devices. Our team had been getting familiar with responsive design and put forward a proposal of doing away with device-specific apps and developing a single responsive website that could be served to both desktop and mobile users. After a few hasty demos and prototypes, the idea was accepted and we began work.

The brief: make our current website, Airport-Hotels.uk, responsive while retaining the existing layout for users on browsers of 1000 pixels and up.

The following is what we picked up along the way.

The general consensus now seems to be “mobile first.” I agree. Starting with a single(ish)-column mobile website is the easiest way to get your CSS off to a great start. However, we use an external design agency, so the time and cost of a new mobile-first design was not feasible. It was left to the front-end developer to translate the existing design onto screens of smaller dimensions.

The solution was to break up the website into smaller blocks (or nuggets), which could then be positioned differently as the browser’s width increased. This led to our first base media query, which contained the main branding elements, with minimal layout information. Because the nuggets were of a fairly fixed size, we had a foundation for creating a grid for each of our major media queries. Anything that wasn’t deemed to be a “nugget,” such as a larger block of text, would be responsive and fill in the gaps that the nuggets couldn’t.

Mobile view of availability results

While this method is not as good a practice as “mobile first,” it does have the advantage of being faster and cheaper than a full redesign. And you pick up great knowledge along the way for when resources do become available for something more substantial.

When getting your feet wet with media queries, you’re tempted to go all out, but do you need to? Theoretically, you could serve a completely different design to each “major” screen resolution. While this would be spectacular and self-satisfying, maintaining it would be a nightmare. We ended up using the default media queries in Andy Clarke’s 320 and Up framework, containing four breakpoints (1382 pixels was not in the brief). Looking back now, we could have removed at least one of those queries, possibly two.

We’ve been gathering statistics in the weeks since the website’s release, and by far the majority of our customers are running browsers either of 320 × 480 pixels or on full desktops. We could hit over 85% of our user base by focusing on these resolutions, while cutting down on development time and maintenance.

This was especially evident on our availability page, which easily contains the most information of any of the pages in our booking flow. In the end, rather than try to serve the perfect design to each device width, we moved much of the CSS for the largest media query to the size below: less maintenance, less fuss, and more time to work on the UX (and, importantly to the business, to make bookings).

When I first saw tools like Modernizr, I thought they would change everything. I suppose they have, but don’t rely on them too much. Mobile browsers have more inconsistencies than any desktop I have ever seen. Even WebKit-based browsers can render things completely differently. With debugging tools at a minimum, it’s like we’ve been thrust back into the pre-developer toolbar era of IE bug fixing. Luckily, that’s one of my favorite things.

Exploring this strange new world of bugs became one of the major aspects of the project. A few of my favorites are highlighted below. Hopefully, they won’t trip you up.

I love CSS columns. I had been wanting to use them for a while; but, other than small personal projects, nothing with appropriate content came up. While trying to work out the best layout for our website on a 320-pixel device, I realized that, rather than generating columns using floats or inline blocks, we could reduce the layout CSS to just a few lines by creating CSS columns. With most major mobile Web browsers being based on WebKit and Opera, this seemed to be a fairly reasonable solution and appeared to lay out everything perfectly. Great!

Here is the original code for the 320-pixel media query:

.product { -moz-column-count: 2; -moz-column-gap: 5px; -webkit-column-count: 2; -webkit-column-gap: 5px; column-count: 2; column-gap: 5px;}

And here is the updated solution (roughly speaking — the actual code was much longer):

.product>div { width: 49%; float: left; margin: 0.5%;}

Unfortunately, the column specification isn’t quite ready yet. On BlackBerrys and some HTC Android phones, our form elements (specifically, the buttons) became unclickable. The layout was perfect — we checked that the CSS was accepted with Modernizr, and all the links worked — and yet you couldn’t click the “Book” button. Back to the drawing board with that one.

We ended up using a more standard float-based column layout.

Gradients were another excellent instance of browser idiosyncrasies. We used a lot of CSS gradients in this redevelopment to replace some images. This should have saved the user’s bandwidth and made redesigns and maintenance faster.

On WebOS (with a WebKit-based browser), though, CSS gradients would render as completely black unless used on a form input element. It was baffling. In the end, we figured out that it was a bug in the implementation of -webkit-linear-gradient. We’ve learned that the bug has been fixed in the upcoming version, so this might not be an issue in the future.

Here is the offending CSS:

.ppcHeader { background: #73bff1; /* Old browsers */ background: -moz-linear-gradient(left, #73bff1 0%, #009ff7 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, right top, color-stop(0%,#73bff1), color-stop(100%,#009ff7)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(left, #73bff1 0%,#009ff7 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(left, #73bff1 0%,#009ff7 100%); /* Opera11.10+ */ background: -ms-linear-gradient(left, #73bff1 0%,#009ff7 100%); /* IE10+ */ background: linear-gradient(left, #73bff1 0%,#009ff7 100%); /* W3C */ margin-bottom: 20px;}

(Bear in mind that CSS gradients add a heavy load to the browser’s rendering engine, so if you are using a lot of them, switching them off for mobile might be wise.)

Basically, JavaScript does not work on Blackberry 5.0. BlackBerry tries, but it’s so inconsistent and buggy that it’s not worth it. We were reliably advised by Peter-Paul Kochs to just resort to device sniffing and to turn off any JavaScript. This is another reason to make sure your websites are progressively enhanced by falling back to non-JavaScript versions.

Meanwhile, Opera Mini works fine with JavaScript, but each of a website’s pages is rendered on Opera’s servers and then essentially compressed into a big image before being sent to the mobile device. This is great for the user because it can reduce bandwidth to 10% of the normal browsing experience. On the other hand, if you have onkeyup validation in your forms, this can be a problem because each call to the JavaScript would require refreshing the entire page from the server.

This was and still is one of the major problems with mobile browsing on our e-commerce website. In order to make a purchase on an average website, the user has to fill in a lot of information: names, addresses, credit-card details, the list goes on and on. While typing on mobile has gotten much easier, navigating large forms is a frustrating and laborious process.

Our mockup payment page had 22 form inputs that needed some kind of interaction. These were required either to make a successful booking, to provide information to the product supplier after booking or for our own sales and data purposes.

Payment form desktop view
Airport hotels payment form, a large screen view. Large version.

Payment form mobile view
Airport hotel’s payment form, a small screen view. Large version.

The question became (as it always seems to be with mobile), what could we remove and what did we have to keep? Well, we tried to take the middle path, which is currently in development or might even be live by the time you read this.

We chose to split our payment process into two stages. Because our users can save more on their purchase by booking early, our first payment stage asks for the very minimum of information required in order to confirm a booking: name, car registration and credit-card details. This gives the user the best price available and chalks up another booking for us. Part two of the payment process is to gather the rest of the information required to “complete” the booking. This second stage can be filled out at the user’s convenience, either immediately or later on using our online booking management system. This eases any frustration caused by having to fill out a large form.

A good user interface means something completely different on mobile devices — and even tablets for that matter. Many of the user-friendly features we have implemented on our desktop website would just be bad ideas on these smaller mouse-less devices.

Lightboxes were all the rage a few years ago. They were a convenient and pretty way to display a small amount of content or something that wasn’t worth loading a new page for. In IE 7 and up, you can position lightboxes using position: fixed, which is great. On mobile devices, though, browsers do not implement position: fixed, or they implement it in an odd way to prevent non-mobile-ready websites from not working at all. This will ruin any lightboxes.

We recommend just loading a new page for lightbox content: less JavaScript, easier and fast. A new tab would also be fine, but due to the infancy of tabbed browsing on mobile devices, maintaining the flow is probably a better idea for now.

Content that is only visible via hovering obviously doesn’t work on touchscreens. What used to be an easy way to hide content while keeping it accessible has become a bit of a nightmare to deal with. We tried just removing the hover and showing the content, to see what would happen. The iPhone actually handles hovers fairly well, translating them into tap events. On Android, you need to click and hold for a little while to prevent the default action of clicking the link (our links are anchor-tag-based).

In the end, modifying the code that handles the hovers (assuming it’s JavaScript) and adding a tap event seemed to be the best solution. This allowed us to preserve the design’s aesthetic, while keeping as much functionality as possible for mobile users.

if( document.createTouch ) { this.addEvent(c[j],'tap',this.tipOver,false);} else { this.addEvent(c[j],'mouseover',this.tipOver,false); this.addEvent(c[j],'mouseout',this.tipOut,false);}

Our date-picker calendar was one of the biggest hurdles to overcome in the UI. We have a text input that allows the user to enter a date. Prior to the date-picker, our solution was a dynamically generated select box, but that caused confusion among many users because they might have remembered the day of the week they were flying on but not the date. So, we added the jQuery UI Datepicker to make filling in the search form one step easier.

However, what was one step forward for convenience on the desktop was one step back on mobile. Focusing the text input would open both the date picker and the phone’s keyboard, thus obscuring the date picker.

Our next option was to use the HTML5 date input. Because this element became available so recently, browsers are still playing catch up, and implementations vary wildly. It’s just as rough on desktop, with Firefox still rendering it as a text input, Chrome adds an up/down selector and forces the date format, while Opera actually renders a calendar just like the jQuery UI Datepicker. This solution still requires the date-picker JavaScript, but it forces the format, which can actually make it less user-friendly. While the concept is great and the solution will be great once the bugs are ironed out, we found that the date type input is not yet ready for commercial use in this fashion.

Our eventual solution (not yet live) was to use a JavaScript “touch event” query to generate a more mobile-friendly date picker than the standard jQuery UI one. This creates an iOS-styled triple drop-down menu for day, month and year and is user-friendly on mobile devices. The no-JavaScript backup can be either a text input or a select drop-down menu. Have a look at the code for yourself.

The final point, which reflects the complexity of mobile development, is how to fit old versions of IE into this new technology. IE 8 and below ignores media queries, which presents a rather sticky problem when your entire website is based on them. There are several solutions to this, which we’ll explore below.

I can think of two great JavaScript polyfill options for media queries. The first is Respond.js, which continually monitors the browser’s width, parses the CSS and then serves the correct styles for that width. This is a great solution if you need the website to respond on IE 8 and below. The main issue is the time between the document loading and the JavaScript kicking in; the website is initially displayed using the base style sheet, usually the mobile view, before it “jumps” to the full desktop version. Obviously, this doesn’t look great on a desktop monitor, and if the user is on an old browser, then their computer and Internet connection will probably be slow, too, which means that the jump time could be even longer.

The other JavaScript option here is the Chrome frame, which achieves the same end and has the same disadvantages. This solution isn’t bad, but just not right for our implementation.

This is one of my favorite options for responsive websites and is also used in the latest version of the 320 and Up boilerplate. Create a separate CSS file for each device width; and for IE, serve them all to the user, with no media queries. With a mobile-first approach and a couple of fixed widths in your IE style sheet, this will serve the full-sized version of the website to users of outdated browsers. This solution is fast, simple and easy to maintain.

Finally, given the right conditions, you could just write a completely separate IE style sheet, full of conditional comments to load the full desktop version of the website. Theoretically, this need only contain small amounts of layout information; but given that many of these styles will be reproduced in your media queries for wider widths, it can cause maintenance issues down the line. Duplicating code is never a good idea, which makes me wary of this solution.

Interestingly, we used this solution in the end, but with a twist. We used a PHP plugin in our template files to combine, compress and cache our CSS files. Due to some issues with the cache in IE, we were already generating a separate cached CSS file for IE users. We added a couple of lines to the PHP file to strip out media queries entirely as it combines and compresses the CSS. This method delivers the results of the “include all media queries” solution, while allowing the option for inline media queries in the style sheet. Because of the way we organized the CSS, this turned out to be the best solution for the project.

After all that, we finally have the first version of our responsive booking flow. I like to think that this epitomizes “mobile-ready.” We aren’t necessarily mobile-optimized, but our feet are on the bottom rung of a tall ladder that climbs to a great system that works perfectly on all devices. This is the starting point, if you will.

Was it worth it? It’s been a long journey, with a lot of head scratching and learning on our feet fast, but that’s what Web development is about, and I wouldn’t have it any other way. You can’t be perfect the first time round, and you don’t have to be. The point is that this technology is ready now, and the sooner you start using it, the better prepared you’ll be for the mobile market as it comes running at you. In the next few years, we’re hoping to see JavaScript network APIs that will allow Web users to add purchases directly to their monthly phone bill. I expect the mobile e-commerce market will explode at that point. Will you be ready?

(al) (da) (il)

Gavyn McKenzie likes downhill skateboarding, pondering semantics, painting with CSS and fine gastronomy. He is currently employed as a front-end web developer at Holiday Extras and dabbles in freelance work for interesting clients.

Yay! You've decided to leave a comment. That's fantastic! Please keep in mind that comments are moderated and rel="nofollow" is in use. So, please do not use a spammy keyword or a domain as your name, or it will be deleted. Let's have a personal and meaningful conversation instead. Thanks for dropping by!

Read more >>

Mobile Development: 5 Tips for Small Businesses

Giles Goodwin is the co-founder and president of Product and Technology at Widgetbox, a leading platform for mobile and web technologies. Giles has more than 15 years experience in building innovative software products and managing computer technologies.
Savvy entrepreneurs, businesses and marketers know that they need a mobile presence –- either via a mobile site, mobile advertisement or mobile app –- in order to capture the ever expanding and on-the-go mobile audience.
But with so many different smartphone operating systems, it can be difficult to know where to begin with the app development process. The good news is that there are now tools that can take the burden of development off your team and make app development easy, affordable and multi-platform — enabling you to build a single app across multiple devices to reach as many consumers as possible.

If you don’t have a mobile presence yet, you need to get one quickly. If you aren’t tech-savvy and don’t have deep pockets to hire a mobile developer, start here with these five basic rules for business mobile app development.
Take advantage of new tools that eliminate the pain and expense typically associated with app development. App development has, until recently, required custom development knowledge for each platform. It is time consuming to learn the coding for each platform and expensive to execute. Unfortunately, these are the main barriers keeping small businesses away from custom apps because they simply do not have the resources for such an endeavor.
However, new tools have emerged to simplify the process of building an app and to cut the associated costs of doing so. There’s no need to code, you can simply use templates to create an app that is useful to your audience. It’s similar to what blogging platforms like WordPress and Tumblr did for creating your own blog or general web presence.
Some affordable options include iSites, and EventMobi.

Many small businesses don’t need a robust app; they just need something that will help bring their content to their customers on mobile devices in a useful and interactive way. Companies can make app development easier and cheaper by sticking to the essentials. For example, a local realtor might not need an app capable of playing dynamic videos of each home she lists — which would be expensive and time consuming to develop — but the app does need to have quality photos and descriptions of home listings and contact information for the realtor.
Creating an app using text, content, visuals, video and resources you already use in other channels allows you to create an app that mirrors your brand with the same rich look and feel of native iPhone and Android apps.
For example, if you are a restaurant owner, you should include your operating hours, menu and wine list. You could then entice the customer to return to the app by including an RSS feed of the daily specials. You could also leverage existing APIs by embedding mapping and public transportation tools to help diners find your business.

By moving outside the app store, you don’t need to wait for unpredictable app approval hierarchy and processes. For those who have developed an app specifically for the iPhone App Store, you know that the approval process can be lengthy and opaque, giving you no insight into when your app will be approved or denied. And then one day, surprise! It’s published.
If you just plan to bring mobile to your existing customers, it may be a better option to distribute a mobile web app directly to them with a custom hyperlink or QR code. This eliminates the need to participate in the iPhone app store, thus bypassing the headache of approvals. You can build the app you want and quickly get it into your customers’ hands.
If you put a QR code on your menu, your restaurant diners could easily scan the code and access the mobile web app while they are waiting for their meal to come. Business owners can distribute their app to customers by including a link to in their newsletters. Customers can easily view the app and save its location to their phone’s home screen, instead of having to go directly to the app store and searching for it.
Since you’re not going through a specific app store, you don’t need to meet specific standards. This means you can simultaneously develop an app for several platforms rather than spending all your time and money with a single platform before moving to the next. This will broaden your reach to help get your small business in front of more customers via your mobile app.
Instead of simply turning your existing web presence into a mobile site, new advances in HTML5 allow business owners to create a native app-like experience right in the mobile browser.
New frameworks like Sencha Touch and SproutCore allow developers to easily take advantage
of HTML5 and CSS3 web standards, enabling web apps to look and feel like native ones. Web apps respond to touch and interact with native functions on the phone, such as maps, calling and e-mail. Additionally, since they are web applications, they can be easily distributed via text messages, QR codes, or social media channels such like Twitter and Facebook.
By following these five cardinal rules for app development, small businesses can quickly and affordably increase their customer engagement via mobile channels that will keep their business top-of-mind.
What tips did you find most useful? Have your own advice for developing great apps on a budget? Let us know in the comments below.

Image courtesy of iStockphoto, pavlen
Read more >>

Do You Make These 8 Personal Development Mistakes?

Most people suck at improving themselves. Even when they’re trying their hardest to become a better person, they wind up running on the dreaded personal development hamster wheel – hours of effort, zero results.

It’s not because they’re stupid. It’s not because they’re lazy. It’s definitely not because it’s not possible. It’s because they’re making the mistakes that most people make when they’re trying to change their life for the better. That’s why there’s so many people reading self-help blogs, self-help books, and taking self-help classes and yet so few people making a meaningful and lasting difference.


So here’s a list of the eight most common (and most damaging) mistakes that people make in personal development.

Are you guilty of any of these?


  • Are You Fixing Your Weaknesses?
    Don’t you just hate being bad at things? It makes you feel dumb playing tennis when you’ve only ever played against Wii characters. You feel small when someone mentions James K. Polk and expects you to know he was the 11th American president (not that anyone would ever expect that).

    So it’s natural to focus the majority of your personal development time on fixing your weaknesses. That’s all well and good, but you get a much better return on that time if you focus on improving your strengths.

    Think of it like this. The vast majority of any successes you have in life will be because of your strengths. Your career security will be based on the strengths you bring to the table. You’ve probably heard of the 80/20 rule (80% of the results come from 20% of the efforts). That’s what I recommend here:

    Focus the majority of your personal development efforts on your top 20% of skills, strengths, and talents. For the rest of the 80% do what you can to avoid them, delegate them to someone else, or create a system to avoid doing them. If a weakness is preventing you from hitting your goals, then get just good enough so that you can continue to focus on becoming an expert at what you’re good at.


  • Do You Want to Become “Better”?
    Why do you focus on personal development? Well, to be a “better” person. To have a “better” life. To have “better” skills.

    ...What does “better” mean?

    Every sane person on earth wants to be “better” in a bunch of ways. That’s a good thing – we’re ambitious. But “better” is a vague goal. We all know the thing about vague goals – vague goals produce vague results. Or in other words, vague goals don’t produce real results.

    Your personal development path must have a purpose. There has to be a reason you’re working on whatever it is you want to improve. That’s the only way anything will actually ever happen. Change “better” to something like “know how to build a website so I can share my advice.” That’s how personal development actually happens in the real world.


  • Are You Learning Awesome Theories?
    Theories are awesome and a lot of them are amazing. Seriously.

    An investment strategy can sky rocket your wealth. A lifestyle design philosophy can get you out of the cubicle. A productivity system can help you get a whole heck of a lot more done.

    But theories are also like crack or girl scout cookies – they’re addictive.

    Once you’re exposed to a compelling theory or philosophy about something, it’s hard not to try to learn everything about it. Then it’s hard not to look for all the other competing theories or philosophies and learn everything about them. Then it’s hard to not look for comparisons to figure out which one’s best.

    Worst of all it’s hard to bring any of the theories into real action.

    It’s helpful to remember this simple concept – “everything that’s not stupid works.”

    For example, there is an infinite number of ways to lose weight – choose from a million diets, exercise programs, supplements, gyms, programs, etc. – but nothing works if you’re doing nothing but researching.

    It doesn’t matter if you have the #1 possible theory. It’s better to just find a path that’s not stupid and stick to it. (You can always improve it later). Learning theories isn’t personal development. Implementing them is.


  • Have You Never Had a Major Failure?
    Avoiding failure makes you feel successful. After all, failure is bad. Right?

    Well, kind of. No one should try to fail. That would make you weird. But if you’ve never had a major failure, then you’ve never really tried to succeed. If you’ve got your skin in the game for long enough something will go wrong. Period.

    Don’t believe me? Name one successful person who’s never failed.

    The strange paradox of it is that you cannot learn much from successes, but the bigger the failure the more you learn. In most aspects of life, people tend to look at the successes and copy them so that they can avoid the failure. The first part is good – copying previous successes is just smart. But you should expect to fail eventually. The only possible way to avoid failing is to not try in the first place.

    Work hard for those failures, because that’s the best way possible for you to grow.


  • Are You Crazy Busy?
    Everyone intends to improve themselves, but it’s just damn hard to find the time (see New Years resolutions).

    You got work, family, obligations, travel, chores, and sleep. Who has time to work on themselves?

    Yep, it’s tough.

    It’s really got to be a matter of priority. How much of a priority is it that you improve yourself, your skills, and your life? It may be obvious that that’s a top priority for you, but real world implementation may be a bit tricky. Time may only allow you to settle for reading advice, not implementing it.

    There’s two solutions:

    First, you can schedule time for whatever kind of personal development you want to focus on. Then you guard that time with your life.

    Second, if you can’t do that for whatever reason, you need to find ways to incorporate your improvement in other activities you have to do anyway.

    Truth be told, you should probably find a way to do both.


  • Did You Choose The Newest and Shiniest Version?
    It’s easier to think that the newest thing out there is the best. The newest strategy, technique, tactic, idea, book, etc.

    It’s true with a lot of things – technology and medicine being two obvious examples. It’s not true with a lot of others.

    Want to get an amazing memory? The best current memory courses are variations on methods from ancient Greece. Want to calculate crazy math problems in your head? India had that figured out about 2,500 years ago.

    We like bells, whistles, and that new car smell, but sometimes we’re missing the old and tested approaches to things. Most personal development is about subjects that are timeless – the mind, the body, the spirit, selling, finances, communication, friendship, love, etc.

    I guess the point here is no matter what you want to improve about yourself many people have gone through the same thing. Don’t make it more complicated than it needs to be.


  • Is Your Personal Development for Personal Development’s Sake?
    If “personal development” doesn’t have a result, then it doesn’t count.

    By “result” I mean a tangible, objective, other-people-can-see-change kind of result. That means you have to get something from your improvement efforts.

    What’s that something.

    Well, if you truly improve yourself then you should see some of the following things come into your life:


    • More money (gasp!) – Yep, if you’re more skilled then you should command a higher income whether your self employed or work for someone else

    • More confidence – You’re more confident when you’re good at something. The more you improve, the more that should happen.

    • More influence – The more you improve in a noticeable way, the more others will value your opinion on things
    If you’re not seeing those things, maybe your personal development path isn’t quite on track. Instead, focus your personal development efforts on things that will cause real world effects.


  • Do You Love to Read?
    Loving to read is great, but dangerous.

    It’s dangerous because it takes you to another world. When you’re reading your imagination sparks and you are inspired by great possibilities. The world in your head is fantastic!

    ...then you go back to the real world.

    With your personal development, spend maximum 25% of your time reading, learning, and researching. The other 75% (or more) should be spent taking action.

    Let’s be honest, with most things we already know what we need to do, or at least where to start. Wanna be fit? Start with jogging before work and stop eating fast food. Wanna make friends? Start by joining a club or organization. Wanna be productive? Close your email.

    For something we just don’t know how to do, finding that information is simple – Google it.
    New information can inspire and motivate, but more often it can derail. So, maximum 25% reading and minimum 75% doing.
So Put Yourself Out There
Testing the quality of your personal development efforts can be one of the most powerful things that you can do today.

Making mistakes can be frustrating (especially when it comes to something personal), but identifying those mistakes allows us to improve. Most progress starts by noticing a mistake and deciding to do something differently in the future.

The worst personal development mistake didn’t make the list. The worst mistake is ignoring or refusing to do anything about failures. It’s turning a blind eye to potential learning opportunities. When that happens, people are doomed to continue running on that personal development hamster wheel.

I didn’t include it, because folks in that situation will always be stuck. On the other hand, if you’re passionately pursuing improvement and have an open mind to change, you’re almost guaranteed to succeed.

So go out there and become great.
Read more >>

Apple Event Reportedly Scheduled For October: All Things

Tired of waiting for the next iPhone? Mark your calendars! The iPhone 5 could be announced at an Apple event on October 4, according to tech blog and Huff Post Tech partner All Things Digital.

AllThingsD reports that, according to "sources close to the situation," new CEO Tim Cook will give the keynote address at an event on October 4, which will be used to introduce the much-anticipated iPhone 5 to the world. The release, according to those same anonymous sources, will come weeks later, presumably before the end of the month. AllThingsD had previously reported that the iPhone 5 would definitely be released some time in October, though they had not given any specific time frames in previous reportage.

Previously, the most popular rumor (from tech site Boy Genius Report) had put the actual launch of the iPhone 5 in early October ,with well-connected Apple blogger Jim Dalrymple confirming, though this latest rumor has the release of the iPhone 5 pushed back once again. The also well-connected AllThingsD all but started the legitimate iPhone 5 release date bonanza with a rumor that the next-gen Apple smartphone would come out in September, though the site has since maintained October as the target launch month.

Apple, of course, has yet to confirm anything or send out invitations to any press event. The company generally held a September media event to announce updates to their iPod line, though this year it appears they will skip talking to the press in September altogether.

For weekly roundups of the latest gossip in the Apple world, check out HuffPost Tech's This Week in Apple Rumors series and, as always, keep checking back for the latest on the iPhone 5 release date.

WATCH:
Read more >>

HTML lists - what's new in HTML 5?

There is a big and justified interest from the web community about the changes introduced in HTML 5 and in the last weeks I'm frequently receiving a lot of questions and requests about this topic. In this post I want to illustrate a quick roundup of some point of interest about the use of lists in HTML 5.
How you know HTML has three types of lists:

- <ul>, unordered list
- <ol>, ordered list
- <dl>, definition list

The HTML <li> tag defines a list item and is used in both <ul> and <ol> lists. <dt> and <dd> tags define a definition term and the related description in a definition list. These tags are all supported in HTML 5 version but there are some little changes in their attributes, in particular:

<ul> and <ol>
the attribute compact and type are not longer supported in HTML 5 (you have to use CSS instead).

<li>
the attribute type, which specifies the type of the list, is not longer supported in HTML 5 (you have to use CSS instead).
The attribute value, which defines the value of the first item of the list, is not longer deprecated and can be only used with the <ol> tag.


Unordered list for navigation bar
Another lists-related question is about the structure of the navigation bar of a website with the introduction of the new <nav> tag in HTML 5. How you know, unordered lists are commonly used to implement the navigation bar of a website. The typical structure of a navigation bar is a <div> tag that contains an unordered list with some items:


Here is the HTML code to implement the basic structure of a navigation bar

<div id="nav">
<ul>
<li><a href="...">link 1</a></li>
<li><a href="...">link 2</a></li>
<li><a href="...">link 3</a></li>
<li><a href="...">link 4</a></li>
<ul>
</div>

In HTML 5, the structure of a navigation bar is the same illustrated in the previous code. The only thing that changes is the the external "container" of the unordered list. You have to use the new <nav> instead a generic <div> tag

<nav>
<ul>
<li><a href="...">link 1</a></li>
<li><a href="...">link 2</a></li>
<li><a href="...">link 3</a></li>
<li><a href="...">link 4</a></li>
<ul>
</nav>


Definition list and the <dialog> tag
Definition lists are not frequently used in web design end a lot of people even ignore their existence! In general their use is mainly suggested when you have to represent a list of items with a related description for each item of the list. Here is the code that describes a generic definition list:

<dl>
<dt>Google</dt>
<dd>Search engine</dd>
<dt>Facebook</dt>
<dd>Social network</dd>
</dl>

Here is the output in a web browser:

Google
Search engine
Facebook
Social network


HTML 5 introduces the new <dialog> tag that uses <dt> and <dl> tags (these tag are used to define a term and its description in a definition list) to describe a conversation. Here is an example of dialog structure

<dialog>
<dt>Anna</dt>
<dd>What time is it?</dd>
<dt>Mark</dt>
<dd>Three o'clock</dd>
<dt>Anna</dt>
<dd>Thanks!</dd>
</dialog>

And here is the output in a web browser:

Anna
What time is it?
Mark
Three o'clock
Anna
Thanks!

*NOTE: the <dialog> tag has been dropped in HTML revision 3859 (2009-09-15). Thanks to Dylan for the suggestion. The new <figure> and <details> tags now use <dt> and <dl> instead of <legend>.

That's all. If you have some suggestion about this topic, please leave a comment. Thanks!
Read more >>
Next Post