WordPress.org

Ready to get started?Download WordPress

Forums

jQuery is not working in 2.7 install (5 posts)

  1. jgramins
    Member
    Posted 5 years ago #

    Hello,

    I have been trying for some time now to get jQuery working in my install of 2.7. This is my first time using WordPress.

    I have looked at every article and tried every solution they offer and nothing works. I have downloaded and tried several themes that use jQuery and they don't work either. I have tried referring them to my main assets file (outside of my WP folder) as well as in the includes folder and the theme folder.

    I tried the noconflict script, I tried the enqueue - pretty much everything I could find both here and Google! And all I want to do is have nice, aliased rounded corners!!

    Here is a snippet that works just fine in the main site (html, not php) to give an idea of what I am doing.

    <script src="assets/jquery/jquery-1.2.6.min.js" type="text/javascript"></script>
    <script src="assets/jquery/jquery.curvycorners.packed.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(document).ready(function() {
    $('.5radius').corner({
    tl: { radius: 5 },
    tr: { radius: 5 },
    bl: { radius: 5 },
    br: { radius: 5 },
    antiAlias: true,
    autoPad: true,
    validTags: ["div"] });
    });
    </script>
    <script type="text/javascript">
    $(document).ready(function() {
    $('.sidebarbox').corner({
    tl: { radius: 5 },
    tr: { radius: 5 },
    bl: { radius: 5 },
    br: { radius: 5 },
    antiAlias: true,
    autoPad: true,
    validTags: ["div"] });
    });
    </script>

    Thanks for any help!!

    Jeff

  2. reflexionstudios
    Member
    Posted 5 years ago #

    In my header I have:

    <script type="text/javascript" src="<?php echo get_bloginfo('template_directory'); ?>/js/jquery-1.2.6.min.js"></script>

    and jQuery works just fine for me.

  3. syncbox
    Member
    Posted 5 years ago #

    should you have to write echo get_bloginfo? wouldn't bloginfo('template_directory') work?

  4. MrCostaMaya
    Member
    Posted 5 years ago #

    Don't know if this will help but here is my story.

    I upgraded to 2.7 and had just about every problem you see here and a few more, my blog was all but dead.

    I tried everything I read and still it was not working. I had decided to scrap it and reinstall the older version.

    In the admin area under tool I saw a reinstall button, I thought what have I got to lose.

    About a minute later it said install complete.

    100% of all the troubles repaired.

    Give it a try, worked for me.

  5. Daniel Craig Jallits
    Member
    Posted 5 years ago #

    The Prototype library was added to WordPress first, so the '$' is set aside for all Prototype functionality. WordPress makes the coder use 'jQuery' in place of '$'. Therefore the first few lines of code should appear as:

    <script type="text/javascript">
    jQuery(document).ready(function() {
    jQuery('.5radius').corner({
    .....
    </script>
    <script type="text/javascript">
    jQuery(document).ready(function() {
    jQuery('.sidebarbox').corner({
    .....
    </script>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags