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
  • #26858

    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):

    Code for the jQuery Script:

    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).

    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

    Rob MacKay

    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.