Google On JavaScript & Responsive Web Design

Jul 24, 2012 - 8:55 am 1 by

Responsive Web Design & GoogleA month ago, Google delivered their recommendation for mobile best practices as going with responsive web design.

Since then, there were many questions about implementation of the responsive web design. One such question was how to use JavaScript.

Pierre Far from Google posted more details of JavaScript with responsive design on Google+. He said they updated the documentation with a page specifically about JavaScript and responsive web design.

Pierre explained:

Using JavaScript potentially gives a neat solution to two questions we've seen:

1. How to include ads from networks that do not support responsive web design.

2. Using images of different sizes/resolutions for different devices.

Following our recommendations detailed above, you can use client-side JavaScript to decide which image or ad network/tag to include in the page while still using the full power of responsive web design.

There are three main methods for using JavaScript with responsive design:

  • JavaScript-adaptive: In this configuration, all devices are served the same HTML, CSS, and JavaScript content. When the JavaScript is executed on the device, the rendering or behavior of the site is altered. If a website requires JavaScript, this is Google's recommended configuration.
  • Combined detection: In this implementation, the website uses both JavaScript and server-side detection of device capabilities to serve different content to different devices.
  • Dynamically-served JavaScript: In this configuration, all devices are served the same HTML, but the JavaScript is served from a URL that dynamically serves different JavaScript code depending on the device's user-agent.

Forum discussion at Google+.

 

Popular Categories

The Pulse of the search community

Follow

Search Video Recaps

 
Google Core Update Volatility, Helpful Content Update Gone, Dangerous Search Results & Ads Confusion - YouTube
Video Details More Videos Subscribe to Videos

Most Recent Articles

Search Forum Recap

Daily Search Forum Recap: April 15, 2024

Apr 15, 2024 - 4:00 pm
Google Search Engine Optimization

Google Goes On Defensive On Its Search Quality & Forum Results Statements

Apr 15, 2024 - 7:51 am
Google Search Engine Optimization

Google Responds To The Verge Mocking Its Search Rankings For Best Printer

Apr 15, 2024 - 7:41 am
Google News

Google Threatens California: Tests Removing Links To Publishers & Pauses Investments

Apr 15, 2024 - 7:31 am
Google Search Engine Optimization

Google Crawl Budget Is Allocated By Hostname

Apr 15, 2024 - 7:21 am
Google AdSense

Google AdSense Publishers Reporting Huge RPM Earnings Drops

Apr 15, 2024 - 7:11 am
Previous Story: Watch Two Recent Google Webmaster Hangouts