pomelo-cn icon indicating copy to clipboard operation
pomelo-cn copied to clipboard

web server 怎么调用shared里的code.js

Open chenyl107 opened this issue 11 years ago • 1 comments

模仿捡宝里的code.js把一些常量定义在这里,game server能正常访问,但是webserver访问不了

window.onload =function() { var Code = require('../../shared/code.js'); console.log(Code); init(); }

目录没错,在index.html里写的代码,WebStorm提示目录没错,command+左键能正常进入文件,但是运行提示 Uncaught Error: Failed to require "../../shared/code.js" from "root"

chenyl107 avatar Mar 15 '13 09:03 chenyl107

客户端要用script标签加进去

xiecc avatar Mar 19 '13 07:03 xiecc