Javascript 引导转盘类型错误:e[g]不是函数

Javascript 引导转盘类型错误:e[g]不是函数,javascript,jquery,html,twitter-bootstrap,jquery-templates,Javascript,Jquery,Html,Twitter Bootstrap,Jquery Templates,我试图从json数据创建一个旋转木马,我使用它来呈现这个旋转木马,换句话说,我使用UsejQuery模板从json数据动态创建旋转木马滑块。这是我的密码: <div id="main-slide-show" class="slide-show" class="carousel slide" data-ride="carousel"> <!-- Indicators --> <ol class="carousel-indicat

我试图从json数据创建一个旋转木马,我使用它来呈现这个旋转木马,换句话说,我使用UsejQuery模板从json数据动态创建旋转木马滑块。这是我的密码:

    <div id="main-slide-show" class="slide-show" class="carousel slide" data-ride="carousel">
        <!-- Indicators -->
        <ol class="carousel-indicators">
        </ol>
        <!-- Wrapper for slides -->
        <div class="carousel-inner" role="listbox">
        </div>
    </div>
    <script class="tmpl-gallery-slider" type="text/html">
        <div class="item">
            <img src="/content/{{html file.fileName}}" alt="{{html title}}">
        </div>
   </script>
但是,当我单击旋转木马的指示器时,我从bootstrap.min.js收到以下错误:

TypeError:e[g]不是一个函数

另一方面,页面加载完成后,在Firebug中使用此代码,将carousel更改为幻灯片1,无错误:

$('#main-slide-show').carousel(1);

现在我的问题是我的代码/解决方案有什么问题?

我也有同样的问题,但它与我如何链接旋转木马控件有关

由于某些代码编辑器的插件pretty print/beautify或可能是网页的复制和粘贴,有一个额外的空间破坏了此控件代码,请在第一行数据幻灯片的下一行后检查额外的空间您必须向右滚动才能看到它:

<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next ">
  <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
  <span class="sr-only">Next</span>
</a>
移除多余的并使用此选项后,一切正常:

<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
  <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
  <span class="sr-only">Next</span>
</a>

PS:在结束之前,还有其他属性带有额外的空格,但在我的案例中,该特定属性是关键。

我也有同样的问题,但这与我链接旋转木马控件的方式有关

由于某些代码编辑器的插件pretty print/beautify或可能是网页的复制和粘贴,有一个额外的空间破坏了此控件代码,请在第一行数据幻灯片的下一行后检查额外的空间您必须向右滚动才能看到它:

<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next ">
  <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
  <span class="sr-only">Next</span>
</a>
移除多余的并使用此选项后,一切正常:

<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
  <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
  <span class="sr-only">Next</span>
</a>

PS:在结束之前,还有其他属性有额外的空格,但在我的情况下,这个特定属性是关键。

我也有同样的问题,只要将幻灯片切换到param到integer,一切都会好起来的

反而

 $('#main-slide-show').carousel($(e.target).attr('data-slide-to'));
使用


我也有同样的问题,只要把你的幻灯片变成param到integer,一切都会好起来的

反而

 $('#main-slide-show').carousel($(e.target).attr('data-slide-to'));
使用


由于这是谷歌的第一个记录,也许它会帮助某些人:

<a class="carousel-control"  data-slide="1" href="#carousel">
<!-- change data-slide to "data-slide-to" -->
<a class="carousel-control"  data-slide-to="1" href="#carousel">

祝你好运

因为这是谷歌的第一个记录,也许它会帮助一些人:

<a class="carousel-control"  data-slide="1" href="#carousel">
<!-- change data-slide to "data-slide-to" -->
<a class="carousel-control"  data-slide-to="1" href="#carousel">

祝你好运

回答得好!谢谢回答得好!谢谢