我正在使用React.js制作一个简单的“Hello World”程序。我期望在html文档的主体部分打印出“Hello World”。
index.html
<html>
<head>
<script src="http://fb.me/react-0.12.2.min.js"></script>
<script>
var HelloWorld = React.createClass({
render: function() {
return <div>Hello, world!</div>;
}
});
React.render(new HelloWorld(), document.body);
</script>
</head>
<body>
</body>
</html>
错误:
Uncaught SyntaxError: Unexpected token <
有人能告诉我我在哪里犯了错吗?