简体   繁体   English

获取错误:未捕获的语法错误:jquery-ui.js和jquery.dataTables.js中出现意外的令牌<

[英]Getting Error : Uncaught SyntaxError: Unexpected token < in jquery-ui.js and jquery.dataTables.js

在此处输入图片说明 enter image description here 在此处输入图片说明

在此处输入图片说明 ck.imgur.com/ooq5Y.png ck.imgur.com/ooq5Y.png

在此处输入图片说明

I am getting these errors and cannot figure out why its happeining,as it was not showing earlier. 我收到了这些错误,无法弄清楚为什么会出现这种错误,因为它没有在前面显示。 Does anyone have any idea about this issue.Please help me. 是否有人对此问题有任何想法。请帮助我。

Thanks in advance 提前致谢

Remove the ng-jq from the html tag, 从html标记中删除ng-jq,

<!DOCTYPE html>
<html ng-app="app">

This is always a flashing sign for 'a wrong file got delivered'. 这始终是“传送错误文件”的闪烁标志。 JavaScript files cannot begin with < , but almost all html files do. JavaScript文件不能以<开头,但是几乎所有html文件都可以。

In this case the index.html is being delivered. 在这种情况下,将传递index.html I am guessing you are using either the angular router or the ui-router and have defined something along the lines of $urlRouterProvider.otherwise('index.html'); 我猜您正在使用角度路由器或ui路由器,并且已经沿$urlRouterProvider.otherwise('index.html');定义了一些内容$urlRouterProvider.otherwise('index.html'); .

This is what's being executed here. 这就是这里正在执行的。 As to why: no idea, we have too little of your code to judge on that. 至于原因:不知道,我们的代码太少,无法判断。

您正在发送带有javascript扩展名的html文件,将文件重命名为html扩展名

it's not for your html code, it is because of your js code and can't see in log which part of your code has problem. 这不是您的html代码,这是因为您的js代码,并且无法在日志中看到代码的哪一部分有问题。 only solution is => check again your currently added js code 唯一的解决方法是=>再次检查您当前添加的js代码

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

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