WebProNews

Tag: web standards

  • Mozilla Is Now Working On A Web Payment Standard

    Mozilla is all about Web standards. The non-profit has made it clear that it wants to move the Web away from plug-ins and third party services to Web APIs that will work across any browser. It’s latest venture tackles a service that many probably never thought needed fixing – Web payments.

    So, what’s wrong with our current Web payment services? Sure, services like PayPal can sometimes be a pain, but it’s not like the entire system needs to be uprooted, right? Mozilla objects to that line of thinking and offers three reasons why the current Web payment system is broken:

  • Users cannot choose how to pay; they have to select from one of the pre-defined options.
  • In most cases, the user has to type in an actual credit card number on each site. This is like giving someone the keys to your expensive car, letting them drive it around the block in a potentially dangerous neighborhood (the web) and saying please don’t get carjacked!
  • Merchants typically have to manage all this on their own: payment processor setup, costly processing fees, and possibly even PCI compliance.
  • To help solve these problems, Mozilla has introduced navigator.mozPay() in Firefox OS. Mozilla says the JavaScript API was inspired by Google’s Wallet API, but contains a few modifications that support multiple payment providers and carrier billing.

    Here’s how navigator.mozPay() works in its current incarnation on Firefox OS:

    When a web app invokes navigator.mozPay() in Firefox OS, the device shows a secure window with a concise UI. After authenticating, the user can easily charge the payment to her mobile carrier bill or credit card. When completed, the app delivers the product. Repeat purchases are quick and easy.

    If that sounds interesting to you, you can start testing it out right now on test builds of Firefox OS. The API can’t accept payments just yet, but Mozilla encourages developers to start working on implementing the API into their Firefox OS apps now.

    Interested developers can check out the Web payment API documentation here. If you want the code libraries, Mozilla currently has them available in Node.JS and Python. Other libraries for more languages are on the way.

  • Google, Apple and Others Team Up To Promote Web Standards

    Google, Apple and Others Team Up To Promote Web Standards

    In some ways, the Web is like the lawless Wild West that you see in movies and television. There are no rules or standards for how things operate. Some organizations like W3C have tried to bring some form of order to the Web, but there’s not been a huge concentrated effort on the part of Web companies to standardize the Web. That all changes today.

    Google, Apple, Facebook and others have announced the immediate availability of Web Platform Docs. It’s only an alpha release for now, but its intentions are nothing short of grandiose. Google says that Web Platform Docs will be a “community-driven site that aims to become the comprehensive and authoritative source for web developer documentation.”

    The first release today is comprised of submissions from the Web Platform Stewards. These are the large companies that have contributed code, tutorials and more to help people create the future of the Web across all browsers. W3C started the site, but other parties like Facebook, HP and Nokia have submitted content for this first release.

    Web Platform Docs is hoping to put the future of Web development in the hands of those who are in the digital trenches day in and day out. These are the people who are constantly innovating the Web and Web Platform Docs gives them a voice to share their knowledge with those who may be just starting or are stuck on a particularly devious bit of code.

    The Web is a pretty wild place, and it will never be fully tamed. Web Platform Docs will hopefully cut down on a number of compatibility and formatting errors that still plague the Web. It may even get more people involved in Web development which can only be a good thing.

  • Firefox Merging Desktop And Mobile Experience Into One

    I think it’s pretty obvious by now that I’m at best a Firefox apologist, and at worst a rabid fan of the browser. That doesn’t mean that I’m unwilling to call out Mozilla and the Firefox team for some of their dumb decisions. Moving to a release cycle akin to Chrome’s was a dumb decision, but we’re living with it and Firefox might be starting to benefit from it. Another gripe I have is that the desktop and mobile experience feel so different, but that won’t be the case for much longer.

    Madhava Enros of Mozilla recently gave a talk at the Firefox Toronto Workweek on how the team is planning on making a single user experience across both Firefox and Firefox Mobile. It’s a pretty ambitious plan only because you usually have to cut corners on the mobile versions of software. The design they have cooked up is pretty interesting as well.

    The mobile version of Firefox was the first to be shown off. The design is a far cry from what I use now on my phone. It has softer edges with actual on screen tabs. No more will I have to slide to the left to look at the currently open tabs in Firefox Mobile.

    Firefox Desktop And Mobile

    The desktop design is called Australis and it simplifies the design down to a Web browser that looks a lot like Chrome. Firefox has been slowly moving that way for a while now with the simplification and consolidation of multiple options into a single button. Australis just takes it to the next logical step.

    Firefox Desktop And Mobile

    We also heard word a while ago that Firefox was working on a Windows 8 Metro version of Firefox. Enros’ presentation gives us our first look at how the Windows 8 Firefox browser will look. It definitely has a large focus on touch since most early users of Windows 8 are probably going to be tablet users with touch screens.

    Firefox Desktop And Mobile

    The new consolidated design doesn’t stop at desktop and browser as the team is also redesigning its developer tools. There’s going to be new designs for all the developer tools that you’ve come to know and love that will hopefully make the user experience more refined.

    Firefox Desktop And Mobile

    Firefox will also be rolling out its Persona application with the new design that allows users to sign in to Firefox for a personalized experience. There were multiple slides that showed mockups of what the sign in process will look like. From the slides shown, we can gather that Persona is going to be just like the current Firefox sync. By using Persona, you can share your tabs, bookmarks and preferences across all versions of Firefox.

    All of these different designs and applications have a Kilimanjaro rating. Think of it as Mozilla’s rating system for where they see their products fitting into their concept of Web standards and services. The higher the rating shows that an application is on its way to fulfilling that goal.

    Here’s the entirety of the slide presentation. Enros promises that a vide of the talk is coming soon. Until then, just pretend that you can hear somebody talking about the new design while you’re checking it out. I think you’ll be impressed by the new look that Mozilla is going for, even if some people are going to cry that it’s just another step towards copying Chrome.

    Ux overview fxworkweek_april2012

    View more presentations from Madhava Enros

    [h/t: Ars Technica]

  • Leverage Browser Strengths For A Faster Site

    We recently talked about reducing HTTP requests. Here’s a quick recap:

    • Slow web pages impede your website’s goals;
    • 90% of a typical web page’s slowness happens after the HTML has been downloaded;
    • Reducing the number of HTTP requests triggered by your page is usually the best first step to making your pages faster;
    • We reviewed some specific techniques for reducing the number of HTTP requests in a given page;
    • We noted that automation can ease or remove the maintenance burden for more invasive optimization techniques

    Next up on the list: taking advantage of the browser’s capabilities to make your web pages faster and more efficient.

    But are they even “pages” any more?

    Modern web pages have outgrown their humble origins and are not really recognizable as “pages” anymore. Except for the simplest and most old-fashioned brochure-ware sites, visiting a website means executing a complex application that is distributed — and executed — across the web.

    Viewed as such, these web applications are comprised of many parts: a client (the browser); one or more origin servers (where the site is hosted); CDN nodes (where static assets are cached); reverse proxy nodes (e.g. for next-gen whole site acceleration services); third-party assets (hosted on various servers); and the networks that connect them all. So it’s time to stop acting like the origin server has to do all the work and the browser can only present the page to the user. The server is just one part of the application, and it’s playing a shrinking role.

    Performance-minded website architects are showing an increasing tendency to shift the burden of work from the (overloaded) server to the (powerful, underutilized) client, and with good reason. In this article I’ll review some of the ways you can make your website faster by easing the burden on your server and giving the browser more responsibility.

    “Put Me In, Coach, I’m Ready To Play!”

    Modern web browsers run on hardware which is staggeringly powerful by historical standards, and which is simply massive overkill for the uses to which most users put them. It is very common for a user to interact with a site without even beginning to strain the RAM or CPU on his or her computer, while waiting far longer than necessary while an overloaded server (often a poorly configured virtual server on shared hardware in a cheap hosting center) struggles to allocate memory and keep up with the flow of requests without crashing under the load. Distributing more work to the client helps keep the server from getting swamped, can help save on bandwidth and hosting costs, makes the application faster and more responsive, and is generally a better architecture. It’s simply a more efficient allocation of available resources. (And even for less powerful clients, like some mobile devices, the high latency costs of HTTP round trips over mobile connections can still make it worthwhile to offload work from the server to the client.)

    But too many web developers continue to treat the browser – the client side of the client-server interaction – as just a simple “view” of the application. It’s better understood as residing at the heart of the application that is the modern web page. The server has its place, but the browser is increasingly where the action is. It’s got tons of under-utilized processing and memory resources, and its capabilities should be respected and used to their fullest.

    Ok, if you’re ready to leverage the client the first thing you’ll need to do is clean up
    your client-tier code. Seriously.

    Use web standards.

    Using web standards is essential for creating maintainable, accessible, future-proof websites. A great side effect is it’s also the best foundation for maximizing performance. Use of modern web standards encourages the separation of content (HTML), styling (CSS), and behavior (JavaScript). Of course, what constitutes “standards” is a surprisingly tricky question to answer. Debates rage around use of vendor prefixes; formal W3C recommendations lag behind the real world by years; religious wars are fought on the topic of abstract specifications vs de facto standards of what browser manufacturers actually implement… you get the point. But — pedantry aside — in general, strive to write front-end code that validates. And be aware of the places where you trigger warnings or errors.

    Recommended validators include http://validator.w3.org/ (for HTML), http://www.jshint.com/ (for JavaScript), and http://jigsaw.w3.org/css-validator/ (for CSS). Read and follow heroes like Jeff Zeldman and Paul Irish and you’ll be well on your way. Leveraging open source UI frameworks and/or boilerplate templates is a smart path to a solid foundation in standards-based front-end code, too. Using web standards doesn’t alone suffice to make your site fast (though it’ll help), but it will make optimization much more practical and achievable.

    Apply MVC in the page.

    The venerable “MVC” (Model/View/Controller) design pattern has long been the well-established best practice for web applications. Traditionally, “model” maps to the structured data you’d put in your database, “controller” is the application tier on the server that handles requests, applies business logic and generates responses, and “view” is everything the server sends back to the browser. But what some developers overlook is that this same MVC pattern can properly be applied in the front end of your website’s code too. Think of the HTML (the DOM, really) as the model, the CSS as the view, and the JavaScript as the controller. Adhering to this conceptual separation – keeping the HTML model (“what it is”) separate from the CSS view (“what it looks like”) and separate from unobtrusive JavaScript controller (“how it behaves”) – tends to make code more efficient and maintainable, and makes many optimization techniques much more practical to apply.

    Leverage Ajax techniques. Properly.

    Don’t refresh the whole page if you don’t have to! Use Ajax. By only requiring small parts of the page to change in response to user actions, you make your site or web application much more responsive and efficient. But be aware, there are different Ajax approaches.

    For example, fetching complete, styled HTML fragments via Ajax may be appropriate for implementing a sophisticated “single-page interface” (SPI) [https://en.wikipedia.org/wiki/Single page_application]. That’s a powerful approach, but don’t take it lightly – serious SEO and usability gotchas abound. If you’re not doing SPI, retrieving chunks of styled HTML from the server is probably not the right thing to do.

    For most common use cases, it’s better and faster to just pull pure data from the server. Client side templating libraries help solve the problem of turning that data into HTML that can be injected into the DOM and displayed. (Here’s a helpful template chooser.) But with or without client-side templates, fetching serialized data is usually the best Ajax approach for performance.

    Validate in the client.

    At the risk of insulting you smart readers, I have to mention the most obvious case for pushing work to the client, just because so many sites get it wrong: form validation. Picture a user, taking the time to fill out your signup or order form. They painstakingly complete the form and submit it. And then they wait. They look at a blinding white blank screen while the form is posted to the server… and processed…and a new page is generated… and sent back… and rendered… until finally… yes, they see — an error? What a waste of time! That’s an unhappy user and a likely candidate to bail out, abandon your site and go to a competitor.

    Whenever possible, validate the user’s form input from within the page, right where the input is happening. In some cases (such as checking for the availability of a username), doing an async request to the server is appropriate. But in many cases all of the validation rules can be implemented in JavaScript and included with the form in the page. This allows you to give the user instantaneous feedback as they complete the form, and it saves the server a lot of unnecessary work.

    Note for security reasons, web applications should always also validate on the server side. (Rule #1 of web app security is that user input cannot be trusted.) So, validate in the client for reasons of performance and UX, and validate on the server for security.

    Let the browser do the data viz.

    One last specific scenario I want to mention is the visual display of quantitative information. Generating charts and graphs — any sort of pretty-looking data visualization — used to be the sole province of the server. Those days are long gone.

    Now, it makes much more sense to push just the raw data from the server to the browser, in the initial page request. If the data set is too large to include in the initial view, it can be updated via Ajax, in response to user interaction. With modern client libraries (like Processing, D3, and Flot), you can create all kinds of stunning interactive data visualizations right there in the browser. Their capabilities go way, way beyond sorting table columns or rendering a pie chart.

    In this way, many user interactions avoid hitting the server at all. And when they do, it’s a small request and response, consuming the minimum amount of network bandwidth and requiring the least possible amount of work from the poor overworked server.

    To recap:

    • Web “pages” aren’t really pages any more, they’re distributed applications
    • Pushing work from the server to the client is a great way to make your site faster
    • Use best practices (web standards and MVC separation in HTML, CSS and JS)
    • Use the right Ajax approach for the job
    • Powerful client-side templating libraries and dataviz libraries abound

    That’s it for this second article. Next time I’ll dive into another area of web performance optimization. In the meantime I’m always interested in feedback and others’ thoughts on web performance.

  • Video Markup Hits Schema.org (Google, Bing, Yahoo)

    Last year, Google, Bing and Yahoo teamed up to announced schema.org, an initiative to supporta a common set of schemas for structured data markup on web pages.

    Schema.org got some rich snippet markup for music a couple months later, which servies like MySpace, Rhapsody and ReverbNation immediately started implementing.

    Google announced today that the trio of companies have no launched a new video markup. Google product manager Henry Zhang writes on the Webmaster Central Blog, “Adding schema.org video markup is just like adding any other schema.org data. Simply define an itemscope, an itemtype=”http://schema.org/VideoObject”, and make sure to set the name, description, and thumbnailURL properties. You’ll also need either the embedURL — the location of the video player — or the contentURL — the location of the video file.”

    In the post, he shares an example of what a typical video player with markup might look like.

    “Using schema.org markup will not affect any Video Sitemaps or mRSS feeds you’re already using,” says Zhang. “In fact, we still recommend that you also use a Video Sitemap because it alerts us of any new or updated videos faster and provides advanced functionality such as country and platform restrictions.”

    “Since this means that there are now a number of ways to tell Google about your videos, choosing the right format can seem difficult,” he adds. “In order to make the video indexing process as easy as possible, we’ve put together a series of videos and articles about video indexing in our new Webmasters EDU microsite.”

    The relevant section on the Schema.org site is here.

  • Autocomplete Type Attribute Can Increase Conversions, Says Google

    Google announced that Chrome is now supporting an experimental “autocomplete type” attribute for form fields that enable developers to unambiguously label text and select fields with common data types, like “full-name” or “street-address”.

    “With this attribute, web developers can drive conversions on their sites by marking their forms for auto-completion without changing the user interface or the backend,” says Google software engineer Ilya Sherman.

    In a proposal for the attribute, it says:

    Autofill agents save users’ time, and help site authors convert users in purchase and registration flows. Autofill works best when site authors are able to directly provide hints to autofill agents as to what data belongs in each field.

    We believe that website authors have strong incentive to facilitate autofill on their forms to help convert users in purchase and registration flows. Additionally, this assists users by streamlining their experience.

    Autocomplete type

    As an example, Google shows this:

    <input type=”text” name=”field1” x-autocompletetype=”email” />

    “We’ve been working on this design in collaboration with several other autofill vendors,” says Sherman. “Like any early stage proposal we expect this will change and evolve as the web standards community provides feedback, but we believe this will serve as a good starting point for the discussion on how to best support autofillable forms in the HTML5 spec. For now, this new attribute is implemented in Chrome as x-autocompletetype to indicate that this is still experimental and not yet a standard, similar to the webkitspeech attribute we released last summer.”

    The proposal for the attribute can be read in its entirety here.

  • Google, Bing, and Yahoo Work Together on Search

    Google, Bing, and Yahoo Work Together on Search

    Bing, Google and Yahoo have teamed up to announce schema.org, an initiative to support a common set of schemas for structured data markup on web pages.

    A representative for Bing tells WebProNews, “Over the past two years, Bing has worked to improve the search experience to better reflect both the evolving Web and changing consumer habits.”

    ” While this effort has a major ‘geek factor,’ it serves as quite a significant advancement for both the search industry and consumers,” he said.

    The site will provide tips and tools for helping sites appear in search results. “It will also help search engines better understand websites, and moving forward, Bing will work jointly with the larger web community and its search partners to extend the available schema categories,” the representative says. “Consumers will also benefit from this effort by experiencing richer search experiences and content from a much broader set of publishers.”

    “At Google, we’ve supported structured markup for a couple years now. We introduced rich snippets in 2009 to better represent search results describing people or containing reviews. We’ve since expanded to new kinds of rich snippets, including products, events, recipes, and more,” says Google’s search quality team. “Adoption by the webmaster community has grown rapidly, and today we’re able to show rich snippets in search results more than ten times as often as when we started two years ago.”

    “We want to continue making the open web richer and more useful. We know that it takes time and effort to add this markup to your pages, and adding markup is much harder if every search engine asks for data in a different way,” the team adds. “That’s why we’ve come together with other search engines to support a common set of schemas, just as we came together to support a common standard for Sitemaps in 2006. With schema.org, site owners can improve how their sites appear in search results not only on Google, but on Bing, Yahoo! and potentially other search engines as well in the future.”

    The search engines also worked together to support the canonical tag.

    Here’s what the schema.org site itself says:

    This site provides a collection of schemas, i.e., html tags, that webmasters can use to markup their pages in ways recognized by major search providers. Search engines including Bing, Google and Yahoo! rely on this markup to improve the display of search results, making it easier for people to find the right web pages.

    Many sites are generated from structured data, which is often stored in databases. When this data is formatted into HTML, it becomes very difficult to recover the original structured data. Many applications, especially search engines, can benefit greatly from direct access to this structured data. On-page markup enables search engines to understand the information on web pages and provide richer search results in order to make it easier for users to find relevant information on the web. Markup can also enable new tools and applications that make use of the structure.

    A shared markup vocabulary makes easier for webmasters to decide on a markup schema and get the maximum benefit for their efforts. So, in the spirit of sitemaps.org, Bing, Google and Yahoo! have come together to provide a shared collection of schemas that webmasters can use.

    Google says it has added over 100 new types and ported all existing types of rich snippets. Where in the past it has supported three different standards for structured data markup, they will no only focus on microdata. Google says it will continue to support existing rich snippet markup formats. They also provide a testing tool for markup here.

    Bing also says that while it accepts a wide variety of markup formats, it is working to simplify the choices for webmasters.