Grow your CSS skills. Land your dream job.

Javascript not working please help

  • # July 13, 2013 at 2:43 am

    So I’ve got a small issue,

    I’ve recently made my website responsive. I’ve gone with the one page idea.

    and now I found that I want as much time on my site as possible, I want to try using 3rd party sites as little as possible so i have decided to post my “example snippets” on my own site, each has a page, and each of the pages has their own containing DIV with the ID of the title in the name so the CSS doesn’t get mixed up. which i found to be working. but keeping in mind that there are jQuery and JS scripts incorperated into these examples. and their all being dumped on one java script file, i found that only ONE of them work. I dont know why the other don’t work.

    http://hajzer.info/examples/category-groups
    http://hajzer.info/examples/hidden-content
    http://hajzer.info/examples/quick-info-swap
    http://hajzer.info/examples/slide-in-navigation
    http://hajzer.info/examples/calculated-form

    I’m also using examples/ as a blank page and having that as the parent page (for the url structure) I’m not sure if that’s the way to do it, but It seems to work for me.

    Also here’s the link to my JS File

    http://hajzer.info/wp-content/themes/redesign_niagara/js/site.js?ver=3.5.1

    # July 13, 2013 at 11:11 pm

    you guys got nothing?

    # July 14, 2013 at 8:03 am

    Without having looked at the problem yet. Why not embed the JS for each page in the HTML? External JS is good because it’s cached, re-used on different pages and all, but here the JS is small so you don’t really need caching and it’s nor re-used either since they are examples.

    Speaking of caching, don’t use ``. Link to the precise version you want to benefit from long term caching (assuming jQuery CDN works the same as Google’s).

    EDIT: Anyway, you’re getting errors because in your JS you assume some elements exists, but they don’t exist on all pages.

    # July 14, 2013 at 11:03 am

    For the javascript insert

    # July 14, 2013 at 11:40 am

    Okay so i’ve moved all the js to its seperate page and updated the jquery library to newest version.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".