0

Here is the order of the includes:

index.html:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js"></script>
<script src="js/main.js"></script>

and here is the js file (Only relevant parts are shown):

$(document).ready(function () {
    'use strict'
  init();
  $('.slider').slider({
          orientation: isVertical,
          range: reverseSlider,
          max: maxVal,
          min: minVal,
          step: stepVal,
          value: 10,
          animate: 1300,
    });
});

init() is just grabbing some values to create the slider. Everything works fine in the browser.

The error is "Uncaught ReferenceError: jQuery is not defined" and it points to the $ symbol in the first line of the javascript file. I've tried to replace "$" with "jQuery" but got the same error.

Any sugestions?

jccampos
  • 354
  • 3
  • 9
  • Do you have any broken html tags in the lines just above the script tags? – 000 Mar 01 '15 at 20:28
  • Are you running your server on https port 443? Depending on your browser's security settings, it might refuse to load http resources from an https site. You can use the protocol like this: `script src="//ajax.googleapis...` – 000 Mar 01 '15 at 20:30
  • @JoeFrambach I'm sorry for the time it took me to check your sugestions. Your last comment worked perfectly, please post it as a answer so i can accept it. – jccampos Mar 04 '15 at 20:34

1 Answers1

3

Are you running your server on https port 443? Depending on your browser's security settings, it might refuse to load http resources from an https site. You can use the protocol like this:

<script src="//ajax.googleapis...
000
  • 26,951
  • 10
  • 71
  • 101