Results 1 to 6 of 6

Thread: Javascript Problem

  1. #1
    Join Date
    Jan 2012
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Javascript Problem

    Hi,

    I set one Image sliver in my site BLog.

    URL : http://cata.mmascot.com/blog/

    Slider Is working But their is error in my jquery generate in consol with every browser.

    Mostly I want to solve it in Firefox and Chrome browser.

    Error is :

    In chrome : Uncaught TypeError: Object function (a,b){return new c.fn.init(a,b);} has no method 'backstretch' /blog/:85
    (anonymous function)


    In Firefox :

    TypeError: jQuery.backstretch is not a function
    [Break On This Error]
    jQuery.backstretch(images[index]);


    Please help me how can i solve it ?

    Thanks in Advance.
    Cristopher.

  2. #2
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    46
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    it looks like you're not actually declaring a function named backstretch. Are you sure that it is an actual function?
    "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
    Anime Views Forums
    Bernie

  3. #3
    Join Date
    Jan 2012
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Javascript Problem

    Quote Originally Posted by bernie1227 View Post
    it looks like you're not actually declaring a function named backstretch. Are you sure that it is an actual function?
    I am using this jquery search from google. So , jquery is come with that slider.

    Slider Is working properly..but consol create this error.
    That i want to remove.
    I m not declare that method or function.

  4. #4
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    46
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    after a quick search, backstretch() is a jquery plugin that you will need to download and link to the page
    "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
    Anime Views Forums
    Bernie

  5. #5
    Join Date
    Mar 2011
    Location
    N 11 19' 0.0012 E 142 15' 0
    Posts
    1,591
    Thanks
    57
    Thanked 99 Times in 97 Posts
    Blog Entries
    4

    Default

    He's already referencing the backstretch plugin in his code.
    Posting Tips + FAQ | Issues? Feel free to PM me
    - keyboard1333[at]gmail[dot]com

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,373
    Thanks
    77
    Thanked 3,421 Times in 3,382 Posts
    Blog Entries
    12

    Default

    Right, the problem is that backstretch is declared on jQuery v 1.6.1 here:

    Code:
     . . . rnate" type="application/rss+xml" title="Cata's Blog in the Works » Feed" href="http://cata.mmascot.com/feed/" />
    <link rel="alternate" type="application/rss+xml" title="Cata's Blog in the Works &raquo; Comments Feed" href="http://cata.mmascot.com/comments/feed/" />
    <script type='text/javascript' src='http://cata.mmascot.com/wp-includes/js/l10n.js?ver=20101110'></script>
    <script type='text/javascript' src='http://cata.mmascot.com/wp-includes/js/jquery/jquery.js?ver=1.6.1'></script>
    <script type='text/javascript' src='http://cata.mmascot.com/wp-includes/js/comment-reply.js?ver=20090102'></script>
    <script type='text/javascript' src='http://cata.mmascot.com/wp-content/themes/sideways/js/jquery.backstretch.min.js?ver=3.2.1'></script>
    <script type='text/javascript' src='http://twitterjs.googlecode.com/svn/trunk/src/twitter.min.js?ver=3.2.1'></script>
    <script type='text/javascript' src='http://cata.mmascot.com/wp-content/plugins/google-analyticator/external-tracking.min.js?ver=6.2'></script>
    <link rel='index' title='Cata's Blog in the Works' href='http://cata.mmascot.com/' />
    <!-- Google Analytics Tracking by Google Analyticator 6.2: http://ronaldheft . . .
    But then later in the code, jQuery is redefined here as version 1.4.2:

    Code:
     . . . tent" class="clearfix">
     
    		
    		<div class="article-wrapper clearfix" style="font-family:'Dosis', sans-serif;">
                <!-- Slider   -->
     <script src="http://cata.mmascot.com/wp-content/themes/sideways/js/jquery.js" type="text/javascript"></script>
    <script src="http://cata.mmascot.com/wp-content/themes/sideways/js/mobilyslider.js" type="text/javascript"></script>
    <script src="http://cata.mmascot.com/wp-content/themes/sideways/js/init.js" type="text/javascript"></script>
    <!--<script type="text/javascript" src="/js/jquery_003.js"></script>-->
    			<div class="slider">
    <div class="sliderContent">
    <div class="item"><img src="http://cata.mmascot.com/wp-content/themes/sideways/images/slider-01.png" alt="" /></div>
    <div class="item"><img src="http://cata.mmascot.com/wp-content/themes/sideways/images/slider-02.png" alt="" /></div>
    <div class="item"><img src="http://cata.mmascot.com/wp-content/themes/sideways/images/slider-03.png" alt="" /></div>
    <div class="item"><img src="http://cata.mmascot.com/wp-content/themes/sideways/images/slider-04.png" alt="" /></div>
    <div class="item"><img src="http://cata.mmascot.com/wp-content/themes/sideways/images/slider-05.png" alt="" /></div>
    </div>
    </div>
           
    			<!-- SIDEBAR -->
    			<ul id="article-sid . . .
    Once that happens, any extensions to jQuery, such as backstretch are lost because jQuery itself is overwritten with another copy of jQuery that doesn't have those extensions.

    The simplest solution if it works is to get rid of the second external script tag to jQuery, in this case the 1.4.2 version one. If things work out, the mobilyslider.js will happily use the version 1.6.1 code, though I would suggest updating that to the more stable 1.6.4 version.

    But there could also be other problems.

    The browser cache may need to be cleared and/or the page refreshed to see changes.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Similar Threads

  1. CSS & Javascript problem
    By Susie56 in forum CSS
    Replies: 3
    Last Post: 03-03-2012, 06:36 PM
  2. little problem with javascript
    By tpravioti in forum JavaScript
    Replies: 9
    Last Post: 01-20-2010, 02:55 PM
  3. Problem with IE 7 and Javascript
    By Rockonmetal in forum JavaScript
    Replies: 16
    Last Post: 09-19-2007, 06:17 PM
  4. Javascript Problem in PHP?
    By Strangeplant in forum PHP
    Replies: 6
    Last Post: 08-21-2006, 07:37 PM
  5. A javascript problem, help me!!!
    By lihang in forum JavaScript
    Replies: 11
    Last Post: 05-11-2006, 12:23 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •