Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other jQuery in a WordPress Plugin

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #26858
    PHPGator
    Member

    Hello all,

    I’m new here, so please be patient. I’ve been working with WordPress for only a short time (and jQuery an even shorter time) and I now have a need to include jQuery in a new plugin I am developing. I’ve read several tutorials on how to do it but for whatever reason it isn’t working. If it’s okay, i’ll just include the pertinent information from my plugin and then my Javascript file. Perhaps someone else can decipher why it isn’t working! :)

    Code for the WordPress Plugin (Some parts removed that I believe are unrelated to why this isn’t working): http://pastebin.com/92wZWdf1

    Code for the jQuery Script: http://pastebin.com/MyZhCjeJ

    Any help would be greatly appreciated. All I want to happen is that when the Level 2 link is clicked the

    is toggled (shows when it was hidden / hides when it was visible).
    #76139
    cybershot
    Participant

    well, there is something you can do here. You have two possible questions as I see it.

    1. Is the jquery working? Meaning are you calling the jquery correctly?
    2. is the actual script that you wrote working?

    To find out what the problem is, i would narrow it down. In your code, delete everything except the function and just throw in an alert like this

    alert(“jquery is working”);

    then run the script. If you don’t get the alert, then you will know what the problem is. If you get the alert then come on back and let us know and we can help you debug your code

    #76063
    Rob MacKay
    Participant

    Yes wordpress uses a queuing system – that is actually really cool because it means it will only load one version of jQuery per instance – the above link should teach you about all that.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Other’ is closed to new topics and replies.