I am trying to learn response.js but am stuck in a "Hello World" script.
My index.html:
<!DOCTYPE html> <html> <head> <script src="https://fb.me/react-0.13.3.js"></script> <script src="https://fb.me/JSXTransformer-0.13.3.js"></script> </head> <body> <div id="example"></div> <script type="text/jsx" src="src/helloworld.js"></script> </body> </html>
and src / helloworld.js:
React.render( <h1>Hello, world!</h1>, document.getElementById('example') );
When I put this code inside <script> in the index.html file, it works fine, but when I move it to a separate file, I get a blank page and a console error:
XMLHttpRequest cannot load file:///home/marcin/Projects/react/src/helloworld.js. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
What is wrong with him?
source share