Innershiv Hardcoded
HTML
<script id="activity-template" type="jquery/tmpl">
<div id="workflow-current" class="formsections">
<header>
<h2 class="pagesection-header">${$data.name}</h2>
</header>
<div id="pages" class="page-container"></div>
</div>
</script>
CSS
section { font-size: 24px; }
header { background-color: red; }
JavaScript
/* innerShiv: makes HTML5shim work on innerHTML & jQuery
* http://jdbartlett.github.com/innershiv
*
* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What The Fuck You Want
* To Public License, Version 2, as published by Sam Hocevar. See
* http://sam.zoy.org/wtfpl/COPYING for more details.
*/
window.innerShiv = (function () {
var div;
var doc = document;
var needsShiv;
// Array of elements that are new in HTML5
var html5 = 'abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video'.split(' ');
// Used to idiot-proof self-closing tags
function fcloseTag(all, front, tag) {
return (/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i).test(tag) ? all : front + '></' + tag + '>';
}
return function (
html, /* string */
returnFrag /* optional false bool */
) {
if (!div) {
div = doc.createElement('div');
// needsShiv if can't use HTML5 elements with innerHTML outside the DOM
div.innerHTML = '<nav></nav>';
needsShiv = div.childNodes.length !== 1;
if (needsShiv) {
// MSIE allows you to create elements in the context of a document
// fragment. Jon Neal first discovered this trick and used it in his
// own shimprove: http://www.iecss.com/shimprove/
var shimmedFrag = doc.createDocumentFragment();
var i = html5.length;
while (i--) {
shimmedFrag.createElement(html5[i]);
}
shimmedFrag.appendChild(div);
}
}
html = html
// Trim whitespace to avoid unexpected text nodes in...