Browse Source

Merge pull request #4853 from zpao/jsfiddle-babel

[docs] Add jsfiddle integration for Babel
main
Paul O’Shannessy 9 years ago
parent
commit
21510160f2
  1. 10
      js/jsfiddle-integration-babel.js

10
js/jsfiddle-integration-babel.js

@ -0,0 +1,10 @@
(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/babel');
tag.textContent = tag.textContent.replace(/^\/\/<!\[CDATA\[/, '');
})();
Loading…
Cancel
Save