TypeError: $(...).slider 不是函数 [英] TypeError: $(...).slider is not a function

查看:38
本文介绍了TypeError: $(...).slider 不是函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否存在依赖于服务器的 jquery 滑块?我正在为 jquery 范围滑块使用 jquery 库和 Ui.只有一个 jquery 库,所以我认为任何冲突都没有问题.滑块在我的 linux 服务器上工作得很好,可以提供正确的输出.但是当我推送代码是我的 IIS 服务器时,我收到了这个错误,上面写着 TypeError: $(...).slider is not a function in mozilla browser and Uncaught TypeError: undefined is not a function in chrome browser.如果服务器无论如何是它的原因,我只是在徘徊.:(如果有人遇到类似情况,请提出建议.

Is there someway jquery slider dependent on server? I am using jquery library and Ui for jquery range slider. There is only one jquery library so i think no question on any conflict. The slider works perfectly fine in my linux server which gives correct output. But when i pushed the code is my IIS server i am getting this error which says TypeError: $(...).slider is not a function in mozilla browser and Uncaught TypeError: undefined is not a function in chrome browser. I am just wandering if server is anyway be the cause for it. :( Please suggest if anyone face something similar.

$(document).ready(function() {
        $("#slider").slider({
          range: "min",
          animate: true,
          value:0,
          min: 0,
          max: 30,
          step: 1,
          slide: function(event, ui) {
            update(2,ui.value); //changed
          }
      });}

推荐答案

jquery和ui都用,就可以了.

Use both Jquery and ui, then it will work.

<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>

这篇关于TypeError: $(...).slider 不是函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆