http://www.telegraph.co.uk/sport/football/world-cup/10886068/England-World-Cup-team-selector.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
if ((!document.addEventListener) || (!Array.prototype.indexOf) || (!Array.prototype.forEach) ) { | |
document.write('<sc' + 'ript src="http://local.bbc.co.uk:1031/news/special/2014/newsspec_7978/content/english/js/lib/vendors/legacy-ie-polyfills.js?v=0.1.0"></sc' + 'ript>'); | |
} | |
</script> | |
<div> | |
<a href="http://local.bbc.co.uk:1031/news/special/2014/newsspec_7978/content/english/frame_1.html?v=0.1.0" id="responsive-iframe-98623215" data-static-iframe-height="600">iFrame</a> | |
</div> | |
<div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://www.telegraph.co.uk/sport/football/world-cup/10886068/England-World-Cup-team-selector.html | |
<script type="text/javascript"> | |
var parentElm = document.getElementsByTagName('script'), | |
domOutput = document.createElement('div'); | |
parentElm = parentElm[ parentElm.length-2 ]; | |
if(Telegraphics.Modernizr.mobileonmobilesite) { | |
var lnk=document.createElement('link'); | |
lnk.setAttribute('rel','stylesheet'); | |
lnk.setAttribute('type','text/css'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# window.onerror | |
Not needed anymore now dev tools are so sophisticated, you can tell the browser to pause on error and then get a full stack trace and a list of all variables in the current scope. | |
# Don't tell people to do this: | |
``` | |
var calc = function calc (a, b) { return a * b; } | |
``` |
In BBC News Visual Journalism we have to test 13 different setups of IE.
Test page:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-language" content="<%= translations[vocab_dir].lang %>" />
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
env -l | |
env: illegal option -- l | |
usage: env [-i] [name=value ...] [utility [argument ...]] | |
jake:responsive-news maslet02$ man env | |
jake:responsive-news maslet02$ | |
jake:responsive-news maslet02$ env list | |
env: list: No such file or directory | |
jake:responsive-news maslet02$ env help | |
env: help: No such file or directory | |
jake:responsive-news maslet02$ env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
var className = ""; | |
if (["ar", "es"].indexOf(translations[vocab_dir].lang) > -1) { | |
className = "rtl"; | |
} | |
%> | |
<body class="<%= className %>"> | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class BBC_Indepthtoolkit_Model_Clickableguide | |
{ | |
public $mainImage = null; | |
public $hotspots = array(); | |
public $hotspotType = ""; // possible values: thumbnail|shape|label | |
public $panels = array(); | |
public $layoutType = ""; // possible values: storybody-halfwide-include|SOMETHING ELSE - STEVE TO CONFIRM | |
public $panelType = ""; // possible values: dyn_full|dyn_half_wide|dyn_full_narrow|dyn_half_narrow|dyn_narrow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTML + CSS are not mutually exclusive | |
Semantic HTML is one of the foundations of modern, professional web development. Semantic HTML is important to us because it increases the machine readability of a website, this is vital for SEO indexing and accessibility (screen readers). But machines read element names and property values, you make HTML more semantic by applying the correct element and by using id and href properties. | |
Search engine bots and screen readers take no semantic value from classes. Classes are semantic in the fact that they describe to us what they are for, but the primary purpose of them is to serve as hooks for developers to hang JS and CSS onto. Classes are semantically useful for describing how they will be presented, not what the content is about. | |
The most important thing for class name semantics in non-trivial (i.e. complex) applications is that they be driven by pragmatism and best serve their primary purpose - providing meaningful, flexible and reusable presentational/behavioura |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import BBC.AWS.CloudFormation | |
from BBC.AWS.CloudFormation import SQS, IAM | |
from BBC.AWS.CloudFormation.Common.ResourcePermissions import SQSActions | |
try: import json | |
except ImportError: import simplejson as json | |
template = BBC.AWS.CloudFormation.Template() | |
template.description = ( |