Forums

  • # December 8, 2009 at 3:26 pm

    Hey folks,

    I just had an odd question and was wondering if this is something I’m missing, or it’s something that just differs per host.

    I’ve started going through more learning in jquery, and one thing that I notice many people do is that they include the .js file, and then instead of putting the code right on the page, they include it as another .js file.

    So instead of this

    Code:

    You’d just have this:

    slide.js code:

    Code:
    $(function() {
    $(‘a.search’).click(function(){
    $(‘#searchbox’).slideDown();
    });
    });

    page code:

    Code:

    So here’s the question: when I include a file like ‘slide.js’, it works perfectly on my localhost, but I can’t seem to get my actual hosting provider to get it to work. When I upload the files, and then test it, nothing happens. It’s only when I put the code right on the page (like the first jquery script) does it work.

    Why does it work on my localhost and not on a provider hosted server?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

icon-anchoricon-closeicon-emailicon-linkicon-logo-staricon-menuicon-nav-guideicon-searchicon-staricon-tag