1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

General javascript Question: Does this look right/safe

Discussion in 'XenForo Development Discussions' started by EQnoble, Jul 8, 2011.

  1. EQnoble

    EQnoble Well-Known Member

    To you js wizards out there, specifically petaining to jQ....does this look OK to you. I replaced the api call in this example as to not give away what I am working on right now. This works currently but I would like to be sure it is a proper usage of and safe to use as far as not breaking any other jQ functionality. Thanks ahead of time.

    Code:
    <script>
    $('.xxxXkush_wrap').each(function() {
        var toggle = $('.xxxXkushthingy', this), content = $('.xxxXThingyCorr', this);
        toggle.click(function(nothanks) {
            nothanks.preventDefault();
            $(content).toggle();
        });
    });
    </script>
    CODE TAG EDITED: 8:19 pm est 7.8.11
     
  2. Kier

    Kier XenForo Developer Staff Member

    Where does 'toggle' come from?
     
  3. Kier

    Kier XenForo Developer Staff Member

    What's it actually supposed to do? I can't actually follow what is supposed to be happening with jqAPIcall() - it doesn't look like it's calling a valid function.
     
  4. EQnoble

    EQnoble Well-Known Member

    I edited it to reflect better what I was trying to do...

    I literally put that there to hide what I was doing...it really doesn't exist you are right:)

    I have edited that code snippet to reflect better it's purpose.
     

Share This Page