title: Uncaught TypeError: Cannot read property 'cycle' of undefined
body: <p>HTML Code: </p>
  
  <pre><code>&lt;ol class="carousel-indicators"&gt;
                  &lt;li data-target="#carousel-popular-devices" data-slide-to="0" class="pip"&gt;&lt;/li&gt;             
                  &lt;li data-target="#carousel-popular-devices" data-slide-to="1" class="pip"&gt;&lt;/li&gt;                 
                  &lt;li data-target="#carousel-popular-devices" data-slide-to="2" class="pip active"&gt;&lt;/li&gt;                  
                  &lt;li class="all"&gt;
                          &lt;a href="3" class="all"&gt;blabla&lt;/a&gt;
                  &lt;/li&gt;   
  &lt;/ol&gt;
  </code></pre>
  
  <p>and this is the part of the javascript : </p>
  
  <pre><code>var $this = $(this), href
    , $target = $($this.attr('data-target') || (href = $this.attr('href')) &amp;&amp; href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
    , options = $.extend({}, $target.data(), $this.data())
    , slideIndex
  
  $target.carousel(options)
  
  if (slideIndex = $this.attr('data-slide-to')) {
    $target.data('carousel').pause().to(slideIndex).cycle()
  }
  
  e.preventDefault()
  </code></pre>
  
  <p>and i am getting <strong>Uncaught TypeError: Cannot read property 'cycle' of undefined</strong> on </p>
  
  <blockquote>
    <p>$target.data('carousel').pause().to(slideIndex).cycle()</p>
  </blockquote>
  
  <p>this line.</p>
  
  <p>I've just started to use js and if its a trivial question, sorry for that.</p>
  
  <p>thanks advance.</p>