Forums

Calling jQuery in 3.0 issue (6 posts)

  1. denzel2364
    Member
    Posted 1 year ago #

    HI there,

    I am following this website to add jquery to my site but its not working.

    http://tecreviews.net/javascript/add-jquery-to-wordpress/

  2. curtismchale
    Member
    Posted 1 year ago #

    put the code from your file on http://pastie.org so we can view it. We also need to know:

    - which theme are you using?
    - provide a link to your site

    the tutorial above should work just fine.

  3. denzel2364
    Member
    Posted 1 year ago #

    The theme that i am using is a cosmetic upgrade from 2.9 default.

    The code i am using is the one from the website.

    And the link: http://bit.ly/aM06Hj

    Ive added the code and HTML example from the example website

  4. Darrell Schauss
    Member
    Posted 1 year ago #

    If the first tutorial with jQuery(document).ready isn't work for you try this way. Also make sure jquery is before your jquary scripts.

    I have been doing this before 3.0 and on 3.0 fine.

    <script type="text/javascript">
    
         var $j = jQuery.noConflict();
    
         // Use jQuery via $j(...) instead of $(..)
         $j(document).ready(function(){
         ...
         });
    </script>

    http://codex.wordpress.org/Function_Reference/wp_enqueue_script

  5. denzel2364
    Member
    Posted 1 year ago #

    ah yes tried than no conflict at that was a problem before 3.0. Seems that you can use $ with this system ok. For some reason i tried adding Googles CDN for jquery and it works fine now. Calling the library with en_queue didnt work but all woking now. Although my jQuery is performing weird inside WordPress:

    $(document).ready(function(){
    				$("li.linknames").each(function() {
    					//add variable for loacting the link
    					var target = $(this).find("a").attr("href");
    					$(this).click(function() {
    $(target).show("fast");
    return false;
    });
    });

    $("a.close").click(function() {
    $(this).parent().hide("fast")
    return false;
    });

    });
    });

    Only the close btn hides but i have called the parent. It works outside of WordPress. Can you see anything? :-0

  6. denzel2364
    Member
    Posted 1 year ago #

    anyone?

Topic Closed

This topic has been closed to new replies.

About this Topic