SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2006
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    WordPress JQuery, script works if I load JQuery from google?

    Hi
    I have a very simple script. I am running it in a WordPress site. WordPress loads jQuery from the includes folder and Firebug shows me it is loading v1.8.3 successfully.
    My script does not work. BUT if I deregister the WordPress JQuery and load JQuery v1.8.3 from google myself my script works.
    The script is very simple..
    Code:
    <script type="text/javascript">
    $(function() {
    	//slidetoggle
    	$('.toggler').click(function(){
    		$(this).parents(".teamMemberRight").children('.toggleMe').slideToggle('fast');
    
    		return false; //ensures no anchor jump
    
    	});
    });
    </script>

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,301
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    Did the WP jQuery script link come before your script in the HTML?

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2006
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, it woks fine if I have this on the line right before the script in my header.php file
    Code:
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,301
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    Yes, but where was WP putting its link?


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
  •