1

我的测试站点在我的本地主机上运行良好,但是当我尝试将它上传到一些免费的托管服务器上时,我的萤火虫会说这样的话。

Uncaught SyntaxError: Unexpected end of input jquery.js:3
Uncaught TypeError: undefined is not a function bootstrap.min.js:6
Uncaught TypeError: Cannot read property 'fn' of undefined bootstrap-tooltip.js:252
Uncaught SyntaxError: Unexpected end of input ckeditor.js:57
Uncaught ReferenceError: jQuery is not defined jquery.fancybox.pack.js:45
Uncaught ReferenceError: $ is not defined 

为什么会这样?

4

1 回答 1

0

Unexpected end根据我的经验,导致错误的 3 个最常见原因:

  1. 文件上传未成功完成。尽管像 FileZilla 这样的一些工具可能会给出成功的消息,但这并不一定意味着服务器正确地存储了文件。最好将文件下载回来并检查原始文件以确保。
  2. 故障/错误配置的服务器可能会在提供整个文件之前中断响应或错误。
  3. 您的 JS 中可能存在语法错误。(例如一个不匹配的大括号会抛出这个错误)。

如您所见,#3 是引发错误的实际原因,而#1 和#2 将导致它发生。

于 2013-08-10T02:38:14.247 回答