Quick jquery help needed

Discussion in 'jQuery' started by Nigel Lew, May 7, 2014.

  1. #1
    Man I hate this stuff sometimes.

    I am likely missing something really simple here but I would like to fix it without re-coding a template.

    Basically here... jnlew.com/clients/choir/faqs

    down on the bottom I am using a faq plugin. When I click on "Who can join" for instance, that should toggle open. Not open a new page. If I update the theme it works fine but would rather not do that as I will be in there yet even longer refactoring things.

    any ideas?

    Nigel
     
    Nigel Lew, May 7, 2014 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,807
    Likes Received:
    4,534
    Best Answers:
    123
    Trophy Points:
    665
    #2
    I couldn't see any js that should be stopping the page from opening, grabbing the text and displaying it so I'd want to have a look at your plugin to see what is actually coded.

    The html all looks like what I'd expect. It's the js that isn't working right.

    btw is this right?
    <script type="text/javascript" src="//connect.facebook.net/en_US/all.js?ver=3.9#appId=224313110927811&amp;xfbml=1"></script>
    Code (markup):
     
    sarahk, May 7, 2014 IP
  3. Nigel Lew

    Nigel Lew Notable Member

    Messages:
    4,642
    Likes Received:
    406
    Best Answers:
    21
    Trophy Points:
    295
    #3
    Well that is what I see in the console so you may be correct actually. I will shut a few things off. I updated the theme and it started working fine but I created way more work to put the theme back in order than it would take to fix this.

    I will check a few things real fast.

    thanks for the response,
    Nigel
     
    Nigel Lew, May 7, 2014 IP
  4. Nigel Lew

    Nigel Lew Notable Member

    Messages:
    4,642
    Likes Received:
    406
    Best Answers:
    21
    Trophy Points:
    295
    #4
    Hmm. Well all facebook stuff removed but I see this now.

    event.returnValue is deprecated. Please use the standard event.preventDefault() instead

    I will dig through some code real fast.

    N.
     
    Nigel Lew, May 7, 2014 IP
  5. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #5
    That's a warning that if you care about old browsers, you'll leave alone. That shouldn't be stopping execution or making it not work.

    There's a reason my prevent(e) method reads:
    		e.cancelBubble = true;
    		if (e.stopPropagation) e.stopPropagation();
    		if (e.preventDefault) e.preventDefault();
    		e.returnValue = false;
    Code (markup):
    Which is going a wee bit overboard, but it works in everything when you want to stop an event from doing ANYTHING other than what you set.

    Really though, that whole accordion thing? I'd just axe that... and style the text up above nicer instead. Don't waste time playing stupid scripting games when delivering CONTENT.
     
    deathshadow, May 8, 2014 IP
  6. Nigel Lew

    Nigel Lew Notable Member

    Messages:
    4,642
    Likes Received:
    406
    Best Answers:
    21
    Trophy Points:
    295
    #6
    Yep, I follow you entirely ;) Adding features to pre-existing work. Wheels sorta fell off a few things. The template the fellow had customized doesn't exactly work with wp3.9. I have to re-factor a few things.

    That is not really what I was doing for him but it is now I reckon lol..

    N.
     
    Nigel Lew, May 8, 2014 IP