jQuery not working on my host?

10,647

Solution 1

my host did not default to have .js in their MIME types, so I had to add it in:

extension: .js

application/x-javascript

Solution 2

You could always let Google do your work for you:

<head>
  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js"></script>
</head>

One pleasant side-effect is that you'll save a little bandwidth, and because many sites now use Google's AJAX API, many users will already have it cached in their browser.

Solution 3

<script src="/jquery.js" type="text/javascript"></script>

http://whoowes.me/jquery.js = 404

Maybe you didn't upload the file to the right place?

(you're not pointing to the /js/ folder)

Solution 4

Make sure you have

$(document).ready(function () {
    ...
});

surrounding your existing code.

Solution 5

The way the site may be configured on IIS is via their virtual directory setup that may not be including you js folder. The server may also not be allowing the site to deliver the js based on file permissions.

I'd say you put a ticket into your webhosting provider and have them look at why the server is not delivering the file. Another option is the IIS server is not set to allow delivery of the js file extension.

Hope this helps

Share:
10,647
user1477701
Author by

user1477701

I like to code and lift weights... I am a full-time full-stack Software Engineer. Received my BS in Computer Science, MBA, MS in Computer Science, and MS in Software Engineering. I spent a few years in the military then working as a contractor overseas which eventually brought me back to the states where I am currently contracting.

Updated on June 15, 2022

Comments

  • user1477701
    user1477701 almost 2 years

    I am working on a site, and everything is working in my local environment as well as on a test server I have here and everything works fine. but when I upload it to my host, nothing seems to work!?

    The Asp.Net javascript validators fire, but any and all of the jquery is not working? I even put in a simple

    $("#test").html("working");
    

    and

    <div id="test></div>
    

    And nothing is happening? I have triple checked that all the js is uploaded (to my /js/ directory

    The site is here: http://whoowes.me (it is in it's infancy still... barely started) and the Login/Register/Contact buttons should all pull a modal popup (not change pages, that should only happen if JS is disabled) and the word 'test' should show up under the menu.

    Can JS be disabled from the server? Wouldn't make sense though as the asp.net javascript validators are showing up?

    I am completely confused here, any ideas would be great!