Forums

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

Home Forums JavaScript jQuery.load() + WordPress = fail

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #37075
    kgscott284
    Participant

    This of course works perfectly fine in practice when it is stand alone and has nothing to do with wordpress…but when ported over there are obviously complications. How can i simply get my dynamic dropdowns to change when using wordpress?!

    PLEASE help!


    jQuery.noConflict();
    jQuery(document).ready(function($) {
    $("#state").change(function() {
    $("#county").load("http://wwwvibrantusa.zippykid.it/wp-content/themes/medica/" + $(this).val() + ".php");
    });
    });​

    Here is the fiddle proving it SHOULD work…
    http://jsfiddle.net/M5XkX/

    I am guessing there is some kind of conflict, perhaps someone can help?!

    #98664
    TheDoc
    Member

    Is that the entirety of the code? If so, you haven’t closed everything properly. There are two open curly brackets but only one closed.

    #98666
    karlpcrowley
    Participant

    TheDoc is right, the code in jsFiddle works because it’s not the same as what you have in the post

    #98673
    karlpcrowley
    Participant

    Is it possible to link us to your site or is it running locally?

    #98678
    karlpcrowley
    Participant

    Very clean looking professional site, I like it
    Where is this drop down? *EDIT found it

    Which script is this function in? there’s quite a few loaded

    #98689
    karlpcrowley
    Participant

    Hi sorry for the delay, I fell asleep :P

    There’s an error in general.js causing it to break

    change

    if ($(this).scrollTop() != 0) {

    to this

    if ($(this).scrollTop() !== 0) {

    I think there might be more though :S

    #98701
    karlpcrowley
    Participant

    For the moment try removing it from general.js and inline it on the page to rule out external errors

    #98824
    TheDoc
    Member

    That stupid little blank space seems to go in there when copy/pasting from jsfiddle. It will completely break the code.

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