Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save icodeforlove/208b7e9f3e6c0912982f to your computer and use it in GitHub Desktop.
Save icodeforlove/208b7e9f3e6c0912982f to your computer and use it in GitHub Desktop.
react-js-harmony-fiddle-integration.js
(function() {
var tag = document.querySelector(
'script[type="application/javascript;version=1.7"]'
);
if (!tag || tag.textContent.indexOf('window.onload=function(){') !== -1) {
alert('Bad JSFiddle configuration, please fork the original React JSFiddle');
}
tag.setAttribute('type', 'text/jsx;harmony=true');
tag.textContent = tag.textContent.replace(/^\/\/<!\[CDATA\[/, '');
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment