javascript - Datepicker Example at jqueryui.com doesn't work -
try this:
navigate to: http://jqueryui.com/datepicker/
cut/paste code in "view source" own new html page , see if works.
tried in chrome , firefox.
one thing noticed don't wrap function in '$(document).ready(function ()'
<!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.10.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.9.1.js"></script> <script src="//code.jquery.com/ui/1.10.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>
try replace
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.9.1.js"></script> <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script> by
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" /> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script> as saied jason aller in comment :
the reason using // @ beginning rather http:// protocol agnostic , work https connections. avoids mixed content security warnings, breaks when protocol file:// – jason aller
add http: before //code.jquery.com
Comments
Post a Comment