#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Posts
    115
    Rep Power
    40

    What's wrong with this code? Jfiddle works, my site doesnt.


    Here's the jsfiddle:
    http://jsfiddle.net/Q2bzT/

    I have put everything exactly like the jsfiddle in my site:
    here

    at the top. I have put the style '.stylechecked' in the css file, as wel as in the css in the header... nothing. What's wrong?
    Last edited by wouz; July 31st, 2013 at 06:21 PM.
    woozy.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    101
    Rep Power
    27
    firebug reports you have an illegal character at the end of your script block:
    Code:
    ....
    });
       ^ right there
    It's some low-byte whitespace character I guess. I think because it's there, the entire block of script is not getting executed.

    ps. Use google chrome's developer tools (ctrl+i I think?) or firebug in firefox, or just the firefox error console (ctrl+shift+j I think?) to see javascript errors happening on your webpage.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Posts
    115
    Rep Power
    40
    Thanks. Deleted it but didnt help.
    I also installed firebug, not sure how it works though. I activated it but i dont see any error count, so i guess its clean now?
    woozy.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    101
    Rep Power
    27
    Start up firebug on your website, go to the Console tab, then reload the webpage. Right now I'm getting "TypeError: $ is not a function". Looks like your local jquery copy has a call to $.noConflict() appended to the end of it, so the $ symbol no longer functions as an alias for jQuery.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Posts
    115
    Rep Power
    40
    I saw the error now in firebug too, and started a quick search.
    Looks like this is common when Wordpress includes it:
    http://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_Wrappers

    So I made the necessary changes and now it works. Thanks so much for your help.
    woozy.

IMN logo majestic logo threadwatch logo seochat tools logo