React and JSX without Facebook CDN
Takes the regular fiddle for React, and uses CDNJS and a written script block instead of the fb.me CDN, which is blocked by many companies.
HTML
<script src="//cdnjs.cloudflare.com/ajax/libs/react/0.10.0/JSXTransformer.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/react/0.10.0/react-with-addons.min.js"></script>
<script>
(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');
tag.textContent = tag.textContent.replace(/^\/\/<!\[CDATA\[/, '');
})();
</script>
JavaScript 1.7
/** @jsx React.DOM */
var Hello = React.createClass({
render: function() {
return <div>Hello {this.props.name}</div>;
}
});
React.renderComponent(<Hello name="World" />, document.body);