On my local and internal (accessible within the company network) server, the jquery-ui slider displays on all pages, however, on our external server (outside the company for external clients), the slider doesn't display on any pages.
Initially, I had all the jquery files pointing to the googelapis.com CDN. I thought this could be the problem, so I copied all the files into my local directory and pointed to those files on the pages. The slider is still not working.
I'm wondering now if there is a specific order the files need to be in order to see them. I've learned that the javascript files should go at the bottom of the page (unless they are needed otherwise for DOM layout), and the .css files always go in the head. However, I saw a thread on SO Script order for jquery with bootstrap where jquery.js, jquery-ui.js and bootstrap.js are in the <head>
tag along with a custom .js file and the .css files. Since the OP checked this answer as the solution, I'll try reordering my files to see if that bullet-proofs my issue.
Question: When should I place js files in the <head>
, especially jquery and bootstrap JS files? If I need to do this, I will only use this reorder on the page where I'm using the sliders, because I'm not sure how this reordering will effect the rest of the site.
Also, I'm wondering why our external server doesn't display the sliders, but my local (xampp) as well as our internal server does display the sliders -- without my having to reorder them at all. Has anyone had this particular issue?
Screenshots:
local/internal server view
external server view
This is the current order of my files:
<head>
<link rel="stylesheet" href="css/jquery-ui-1-11-4.min.css">
<link rel="stylesheet" href="css/jquery-ui-1-11-4-smoothness.structure.css">
<link rel="stylesheet" href="css/jquery-ui-1-11-4-smoothness.theme.min.css">
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/bootstrap-custom.css">
<link rel="stylesheet" href="css/styles.css">
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<link rel="stylesheet" href="css/ie10-surface-vp.css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- Custom styles for this template -->
<link rel="stylesheet" href="css/navbar-fixed-top.css">
</head>
<!-- body content here -->
<!-- before end body -->
<script src="js/jquery-1-11-3.min.js"></script>
<script src="js/jquery-ui-1-11-4.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/bootstrap-toggle-2-2-2.min.js"></script>