Building an awesome responsive website

I’ve recently worked (and at the time of writing, still working) on a project that emphasises on the mobile user experience. Our client wanted a site that looks good and functions well on mobile devices, and works just as well on the desktop.

There are several approaches to developing for mobile users. You could provide device-specific templates, and have your web server serve the appropriate template based on the browser or device ID provided in the request header. This makes it easier to build templates that target specific devices, and provide the best user experience for those devices.

EPiServer has included a neat feature, called Display Channels, that does exactly. All you, as a developer, have to do is include the necessary templates, and you’re all set to serve your mobile users.

jQuery: 'Member not found' error in IE7

Recently I’ve been working with a jQuery dropdown plugin called ddSlick Remablized, which is a plugin that allows you to have customised dropdowns on your page. However, after implementing it in one of my projects, I’ve discovered a bug in Internet Explorer 7, which looks something like this:

Image of the 'Member not found' error

RequireJS: Manage caching using ASP.NET assembly version

RequireJS is a great library for dynamically loading JavaScript modules. It’s great in projects where you want to control what gets loaded where, and only load files that are essential to the page currently being displayed. On top of that, it has an awesome dependency control system. All you have to do is define what your module depends on, and it will automatically and dynamically load up all the necessary modules along with their dependencies, provided they’re defined.

However, the problem with dynamically loading JavaScript files is that they have a tendency to get cached. While this is good for your visitors, because you don’t want them to have to repeatedly download the same JavaScript files, the problem is when you update your files.

Localising your JavaScript in ASP.NET

Most modern websites use JavaScript to display some form of text, be it for client-side validation or just simple alerts and notifications. While this is fine on a single language website, it can cause some major headaches with multilingual ones.

ASP.NET has provided a way to implement localisation using resource files, and while this is great for web forms and Razor views, the same can’t be said about JavaScript codes.

One solution would be to create a JavaScript translation file that contains localised text for every language you’re planning to support. But since I’m already using resource files, why not leverage that and use them to localise my JavaScript?

Mads Kristensen has posted a very interesting solution for developers who want to use resource files for localising their JavaScript code. You can see it here.

Be more productive with Mockjax

It’s common knowledge that when working in a group we always break the tasks down into smaller portions so as not to choke anyone with too much work. It’s also common for most people working in groups to try and get things done in parallel.

I work mostly with front-end stuff, while my team-mates work on the back-end stuff. Once we get our assigned tasks done, we get together and spend some time getting everyone’s code to play nice with each other.

But sometimes, due to unforeseen problems, the tasks don’t get done in time, and one side will need to wait for the other side to get their code up and running. I have, on occasions, had to wait for the back-end code to be up and running before I can test anything, and obviously there are times when it’s the opposite.

I work with a lot of Ajax stuff, and this means sending data to web services, getting a response, and reacting based on said response. Pretty standard stuff.

Pagination


© 2017. All rights reserved.

Powered by Hydejack v7.5.1