简体   繁体   English

react.js chrome浏览器相关问题

[英]react.js chrome browser related issue

when I am typing react.js code that is given in bucky's react.js tutorial series it is not getting executed but when pasting it from bucky's github repo. 当我键入bucky的react.js教程系列中给出的react.js代码时,它不会执行,而是从bucky的github存储库中粘贴时。 it is getting executed.....Can any one help me out please...and the code is. 它正在被执行.....任何人都可以帮我...代码是。

<html>
<head>
<title>
    creating component
</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="text/javascript" src="C:\Users\hatim\Desktop\react\React-Boilerplate-master\src\js\react.min.js"></script>
<script type="text/javascript" src="C:\Users\hatim\Desktop\react\React-Boilerplate-master\src\js\react-dom.min.js"></script><script type="text/javascript" src="C:\Users\hatim\Desktop\react\React-Boilerplate-master\src\js\browser.min.js"></script>
</head>
<body>


<div id="container_new"></div>

<script type="text/babel" >

var mycomponent=React.createClass({
        render: function(){
            return(<p>this is new component </p>);

        }

});

ReactDOM.render(<mycomponent />,document.getElementById('container_new'));

</script>
</body>
</html>

I don't believe you can include the JavaScript files in the context of the location on your hard drive "c:\\". 我认为您无法在硬盘驱动器“ c:\\”上的位置上下文中包含JavaScript文件。 I think you need to be running them using a web server (IIS, Node, etc.) and then include them using relative or absolute web paths ( http://localhost/mytest/src/js/react-dom.min.js ). 我认为您需要使用Web服务器(IIS,Node等)运行它们,然后使用相对或绝对Web路径( http://localhost/mytest/src/js/react-dom.min.js )包含它们)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM