ethereum Pet Shop

Posted on 2018-11-29 14:16  eilinge  阅读(232)  评论(0编辑  收藏  举报
在部署宠物商店时遇到的一些坑,给大家总结一下,以免大家多走弯路
转载的地址(详细):https://steemit.com/cn/@lucia3/ethereum-pet-shop
启动"npm run dev":
bootstrap.min.js:6 Uncaught Error: Bootstrap's JavaScript requires jQuery
at bootstrap.min.js:6
导致的原因:bootstrap加载的顺序有问题,必须先引用jquery.min.js文件,然后再引用botstrap的js。
解决办法:
  一:
    
<!--script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script-->
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
  二:
    1.npm install jquery@1.7
    2.将下载的node_modules\jquery\tmp\jquery.js文件移至src\js目录下     3.修改index.js文件:
<script src="js/jquery.min.js"></script> <script src="js/jquery.js"></script> <!--script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script --> <!-- Include all compiled plugins (below), or include individual files as needed --> <script src="js/bootstrap.min.js"></script>
GET https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js net::ERR_PROXY_CONNECTION_FAILED
导致原因:无法连接网站
解决办法:在index.js文件中将其注释掉;
    <!--script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script-->
Uncaught TypeError: url.indexOf is not a function
    at jQuery.fn.init.jQuery.fn.load (jquery.js:9857)
    at HTMLDocument.<anonymous> (app.js:132)
    at mightThrow (jquery.js:3534)
    at process (jquery.js:3602)

导致原因:".load, .unload, and .error, deprecated since jQuery 1.8, are no more. Use .on() to register listeners."

解决办法:
    1.下载"npm install jquery@1.7",步骤同上
    2.修改app.js:132
        $(window).load(function()-->$(window).on('load', function(){...}