Jelle
Jelle

Reputation: 104

jQuery working locally but not on my server

yesterday I put my first website online at Leaguestrats.com and everything seemed fine but others weren't able to access it so I fixed that and someone told me to check i through http://anonymouse.org/ to see if it's working fine and now I see that my dropdown menu isn't working, even though it's working just fine locally.

Here's where I link my files in the head tag

<!-- CSS -->
<link rel="stylesheet" type="text/css" href="styles/style.css">
<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- BS JS -->
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>

Any ideas what's causing this? I'm using the dropdown from Bootstrap if that helps

Upvotes: 0

Views: 1752

Answers (4)

galenandrew
galenandrew

Reputation: 220

I would recommend changing your script protocol to dynamically load the resources under the current protocol (e.g. https if your site is under an SSL or http if not).

For example:

<!-- CSS -->
<link rel="stylesheet" type="text/css" href="styles/style.css">
<!-- jQuery -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- BS JS -->
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>

Upvotes: 2

landerskd
landerskd

Reputation: 21

I would try loading bootstrap.min.js AFTER you are loading jQuery. Bootstrap needs jQuery as a dependency.

From Bootstrap's docs... "jQuery required Please note that all JavaScript plugins require jQuery to be included"

Upvotes: 1

Lian
Lian

Reputation: 2357

Try loading all scripts from https instead of mixing http and https.

Here's why you shouldn't mix both.

Upvotes: 4

BobbyTables
BobbyTables

Reputation: 4695

I cannot acces the proxy you linked, but maybe the browser or the proxy does not load the files correctly, i wouldnt trust a proxy as a reliable "other users experience" because of all the tricks it might use.

Check with the web developer tools (usually F12) in your browser if the files are loaded, theres probably a "newtwork" tab that shows this

Upvotes: 0

Related Questions