Javascript错误:未捕获ReferenceError:require未定义 [英] Javascript error : Uncaught ReferenceError: require is not defined

查看:151
本文介绍了Javascript错误:未捕获ReferenceError:require未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用javascript制作HTML格式的注册表单。我有文件Login.js。
我的浏览器显示以下错误:Uncaught ReferenceError:require is not defined。

解决方案

require是一种让不同编译器在稍后保存文件的同时放入所需内容的方法。您是否从其他地方复制了js文件?



您可能需要包含 http://requirejs.org/



另外,这看起来非常不安全。你打算发布这个网站的话?或者只是为了课堂/实验?



正如一个评论所提到的,如果这应该是服务器端代码,那么它就不能很好地工作客户端。

I making a regster form in HTML, with javascript. I Have file Login.js. My browser says the following error: Uncaught ReferenceError: require is not defined.

解决方案

require is a way for different compilers to put in stuff that is needed, later on, while keeping the file small. Did you copy the js file from somewhere else?

You may need to include http://requirejs.org/

Also, this looks incredibly insecure. Are you planning to release this site to the word? or is it just for class/experiment?

As the one comment mentions, if this is supposed to be server-side code, it's not going to work very well on the client side.

这篇关于Javascript错误:未捕获ReferenceError:require未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆