sretko
sretko

Reputation: 640

Can't seem to get jQuery UI Date Picker to work correctly

I'm trying to embed jQuery UI Date Picker. I have got the code from here - https://jqueryui.com/datepicker/

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>jQuery UI Datepicker - Default functionality</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css">
  <script>
  $(function() {
    $( "#datepicker" ).datepicker();
  });
  </script>
</head>
<body>

<p>Date: <input type="text" id="datepicker"></p>


</body>
</html>

The problem is I can't see the actual datepicker but only the input box even when clicking over. Are there any additional steps I should go through in order to make it work or is there something else wrong I'm doing?

Upvotes: 0

Views: 831

Answers (1)

drosam
drosam

Reputation: 2896

If you see the console you will see something like this

file:///Users/David/Developer/code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css Failed to load resource: net::ERR_FILE_NOT_FOUND file:///Users/David/Developer/code.jquery.com/jquery-1.10.2.js Failed to load resource: net::ERR_FILE_NOT_FOUND file:///Users/David/Developer/code.jquery.com/ui/1.11.4/jquery-ui.js Failed to load resource: net::ERR_FILE_NOT_FOUND

Just add http:// when you add the resources and will work

<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>

Upvotes: 1

Related Questions