JQuery cookie没有方法

时间:2013-07-02 06:16:10

标签: javascript jquery jquery-ui jquery-plugins

当我尝试从下拉列表中更改语言德语时,我收到错误。

  

(对象函数(a,b){return new e.fn.init(a,b,h)}“没有方法'cookie')。

我的html文件中有所有插件。同样的。无法解决问题。感谢您的支持和帮助。等待您的快速回复

   <script type="text/javascript" src="/etc/designs/mycomp/js/jquery.min.js"></script>
<script type="text/javascript" src="/etc/designs/mycomp/js/custom-form-elements.js"></script>
<script type="text/javascript" src="/etc/designs/mycomp/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/etc/designs/mycomp/js/jquery.cycle.js"></script>
<script type="text/javascript" src="/etc/designs/mycomp/js/selectivizr-min.js"></script>
<script type="text/javascript" src="/etc/designs/mycomp/js/jquery-ui-1.8.16.custom.min.js"></script>
<script type="text/javascript" src="http://use.typekit.com/ksd7ghl.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
<script type="text/javascript" src="/etc/designs/mycomp/js/global.js"></script>
<script type="text/javascript" src="/etc/designs/mycomp/js/qtip/jquery.qtip.min.js"></script>
<script type="text/javascript" src="/etc/designs/mycomp/js/calculators/main.js"></script>

2 个答案:

答案 0 :(得分:0)

标准jQuery中没有cookie方法。 下载jquery.cookie.js.

答案 1 :(得分:0)

没有这样的方法可以简单地执行Cookie相关选项:

 <script src="path/to/jquery.js"></script>

你必须使用:

<script src="path/to/jquery.cookie.js"></script>

然后简单地说:

$.cookie("visits", 10);

此代码跟踪用户访问网站的次数: