简体   繁体   English

JavaScript错误-无效或意外的令牌

[英]Javascript error - Invalid or unexpected token

Suddenly my js files are not loading. 突然我的js文件未加载。 Below are the errors i am getting. 以下是我遇到的错误。

main.js:70 Uncaught TypeError: jQuery(...).actual is not a function
    at centerHomeBannerText (main.js:70)
    at main.js:74
centerHomeBannerText @ main.js:70
(anonymous) @ main.js:74

jquery.validate.min.js:4 Uncaught SyntaxError: Invalid or unexpected token

owl.carousel.js:394 Uncaught SyntaxError: Unexpected token ===

Below are the code. 下面是代码。 You can see how i am loading js files. 您可以看到我如何加载js文件。

<script src="./js/angular.min.js"></script>
<script type="text/javascript" src="cordova.js"></script>
<script src="./js/jquery-2.1.3.min.js"></script>
<script src="./js/moment.min.js"></script>
<script type="text/javascript" src="./js/index.js"></script>      
<script src="./js/jquery.ui.widget.js"></script>
<script src="./js/bootbox.min.js"></script>
<script src="./js/modernizr.custom.js"></script>
<script src="https://www.mywebsitename.com/libs/bootstrap/js/bootstrap.min.js"></script>
<script src="./js/wow.min.js"></script>
<script src="./js/jquery.isonscreen.js"></script>
<script src="./js/script.js"></script>
<script src="./js/main.js"></script>
<script src="./js/jquery-migrate-1.2.1.min.js"></script> 
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>

When i inspect Jquery.validate in chrome. 当我检查Jquery.validate中的Jquery.validate时。 It is showing below. 如下所示。

oy:funct�Q��Q��i���XR�R��R�lTo-blur").off(".validate-equalTo"

it may b the sequence issue just move your jquery scripts at topmost 它可能是序列问题,只是将您的jquery脚本移到最顶部

<script src="./js/jquery-2.1.3.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<script type="text/javascript" src="cordova.js"></script>    
<script src="./js/moment.min.js"></script>

<script src="./js/bootbox.min.js"></script>
<script src="./js/modernizr.custom.js"></script>
<script src="https://www.mywebsitename.com/libs/bootstrap/js/bootstrap.min.js"></script>
<script src="./js/wow.min.js"></script>

<script src="./js/jquery.isonscreen.js"></script>
<script src="./js/script.js"></script>

<script src="./js/main.js"></script>
<script src="./js/jquery-migrate-1.2.1.min.js"></script> 

I don't know whether I am right or wrong. 我不知道我是对还是错。 let me post my opinion. 让我发表我的意见。

I think .actual() is third party plugin, not a jQuery function and I dont see .actual() has been imported in your script list. 我认为.actual()是第三方插件,而不是jQuery函数,我看不到.actual()已导入您的脚本列表中。

Also, You have to move the jquery migrate plugin after jQuery script. 另外,您必须在jQuery脚本之后移动jquery迁移插件。

Please correct me if I am wrong. 如果我错了,请纠正我。

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

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